Unit tests fixes...

SVN:trunk[3755]
This commit is contained in:
Denis Flaven
2015-09-12 14:34:35 +00:00
parent 11b768dace
commit d2e78d0292

View File

@@ -3727,6 +3727,30 @@ class TestLinkSetRecording_NN_WithDuplicates extends TestBizModel
'history_removed' => 0, 'history_removed' => 0,
'history_modified' => 0, 'history_modified' => 0,
), ),
array(
'description' => 'Change on attribute on both links at the same time',
'links' => array(
array(
'networkdevice_id' => $iDev2,
'connectableci_id' => $iServer,
'network_port' => 'PortDev B',
'device_port' => '',
),
array(
'networkdevice_id' => $iDev1,
'connectableci_id' => $iServer,
'network_port' => 'PortDev A',
'device_port' => '',
),
),
'expected-res' => array (
"$iDev1, test device A, unit test linkset, PortDev A, , downlink, test device A",
"$iDev2, test device B, unit test linkset, PortDev B, , downlink, test device B",
),
'history_added' => 0,
'history_removed' => 0,
'history_modified' => 2,
),
array( array(
'description' => 'Removing A', 'description' => 'Removing A',
'links' => array( 'links' => array(
@@ -3784,13 +3808,13 @@ class TestLinkSetRecording_NN_WithDuplicates extends TestBizModel
array( array(
'networkdevice_id' => $iDev2, 'networkdevice_id' => $iDev2,
'connectableci_id' => $iServer, 'connectableci_id' => $iServer,
'network_port' => '', 'network_port' => 'portX',
'device_port' => '', 'device_port' => '',
), ),
array( array(
'networkdevice_id' => $iDev2, 'networkdevice_id' => $iDev2,
'connectableci_id' => $iServer, 'connectableci_id' => $iServer,
'network_port' => '', 'network_port' => 'portX',
'device_port' => '', 'device_port' => '',
), ),
), ),
@@ -3942,14 +3966,14 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
$iPerson1 = $oPerson->GetKey(); $iPerson1 = $oPerson->GetKey();
$oPerson = MetaModel::NewObject('Person'); $oPerson = MetaModel::NewObject('Person');
$oPerson->Set('name', 'test Person B'); $oPerson->Set('name', 'test person B');
$oPerson->Set('first_name', 'totoche'); $oPerson->Set('first_name', 'totoche');
$oPerson->Set('org_id', 3); $oPerson->Set('org_id', 3);
$oPerson->DBInsert(); $oPerson->DBInsert();
$iPerson2 = $oPerson->GetKey(); $iPerson2 = $oPerson->GetKey();
$oTypes = new DBObjectSet(DBSearch::FromOQL('SELECT ContactType WHERE name="Manager"')); $oTypes = new DBObjectSet(DBSearch::FromOQL('SELECT ContactType WHERE name="Manager"'));
$iRole = $oTypes->Fetch(); $iRole = $oTypes->Fetch()->GetKey();
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Scenarii // Scenarii
@@ -3981,7 +4005,7 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
), ),
), ),
'expected-res' => array ( 'expected-res' => array (
"unit test linkset, $iPerson1, test person A, $iRole, Manager, totoche test person A, ", "unit test linkset, $iPerson1, test person A, $iRole, Manager, totoche test person A, Manager",
), ),
'history_added' => 0, 'history_added' => 0,
'history_removed' => 0, 'history_removed' => 0,
@@ -4003,7 +4027,7 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
), ),
'expected-res' => array ( 'expected-res' => array (
"unit test linkset, $iPerson1, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson1, test person A, 0, , totoche test person A, ",
"unit test linkset, $iPerson2, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson2, test person B, 0, , totoche test person B, ",
), ),
'history_added' => 1, 'history_added' => 1,
'history_removed' => 0, 'history_removed' => 0,
@@ -4025,7 +4049,7 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
), ),
'expected-res' => array ( 'expected-res' => array (
"unit test linkset, $iPerson1, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson1, test person A, 0, , totoche test person A, ",
"unit test linkset, $iPerson2, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson2, test person B, 0, , totoche test person B, ",
), ),
'history_added' => 0, 'history_added' => 0,
'history_removed' => 0, 'history_removed' => 0,
@@ -4041,7 +4065,7 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
), ),
), ),
'expected-res' => array ( 'expected-res' => array (
"unit test linkset, $iPerson2, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson2, test person B, 0, , totoche test person B, ",
), ),
'history_added' => 0, 'history_added' => 0,
'history_removed' => 1, 'history_removed' => 1,
@@ -4062,7 +4086,7 @@ class TestLinkSetRecording_NN_NoDuplicates extends TestBizModel
), ),
), ),
'expected-res' => array ( 'expected-res' => array (
"unit test linkset, $iPerson2, test person A, 0, , totoche test person A, ", "unit test linkset, $iPerson2, test person B, 0, , totoche test person B, ",
), ),
'history_added' => 0, 'history_added' => 0,
'history_removed' => 0, 'history_removed' => 0,