abstract class PropertyAccessorCollectionTestCase extends PropertyAccessorArrayAccessTestCase
{ public function testSetValueCallsAdderAndRemoverForCollections() { $axesBefore =
$this->
getContainer([1 => 'second', 3 => 'fourth', 4 => 'fifth'
]);
$axesMerged =
$this->
getContainer([1 => 'first', 2 => 'second', 3 => 'third'
]);
$axesAfter =
$this->
getContainer([1 => 'second', 5 => 'first', 6 => 'third'
]);
$axesMergedCopy = \
is_object($axesMerged) ?
clone $axesMerged :
$axesMerged;
// Don't use a mock in order to test whether the collections are
// modified while iterating them
$car =
new PropertyAccessorCollectionTestCase_Car($axesBefore);
$this->propertyAccessor->
setValue($car, 'axes',
$axesMerged);
$this->
assertEquals($axesAfter,
$car->
getAxes());
// The passed collection was not modified
$this->
assertEquals($axesMergedCopy,
$axesMerged);
} public function testSetValueCallsAdderAndRemoverForNestedCollections() {