-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
This behavior has been mentioned in #13731 by @Tobion and fixed in #13835 by @bananer but was reintroduced later (my guess would be #18224 as it introduced the code that replaces the array).
In the following test case the second assertion fails because after the setValue
call the publicAccessor
property of object has the value array('value2' => 'baz')
instead of array('value1' => 'foo', 'value2' => 'baz')
.
public function testArrayNotBeeingOverwritten()
{
$value = array('value1' => 'foo', 'value2' => 'bar');
$object = new TestClass($value);
$this->propertyAccessor->setValue($object, 'publicAccessor[value2]', 'baz');
$this->assertSame('baz', $this->propertyAccessor->getValue($object, 'publicAccessor[value2]'));
$this->assertSame(array('value1' => 'foo', 'value2' => 'baz'), $object->getPublicAccessor());
}