Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 18759e1

Browse files
committed
Added more tests for PropertyAccess
1 parent 380e2ba commit 18759e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ public function testGetValueNotModifyObject()
139139
$this->assertSame(array('Bernhard'), $object->firstName);
140140
}
141141

142+
/**
143+
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchIndexException
144+
*/
145+
public function testGetValueNotModifyObjectException()
146+
{
147+
$propertyAccessor = new PropertyAccessor(false, true);
148+
$object = new \stdClass();
149+
$object->firstName = array('Bernhard');
150+
151+
$propertyAccessor->getValue($object, 'firstName[1]');
152+
}
153+
142154
/**
143155
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
144156
*/

0 commit comments

Comments
 (0)