diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php index 9f10b95e43..981fabaf6e 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php @@ -173,7 +173,9 @@ abstract class PropertyAccessorCollectionTest extends \PHPUnit_Framework_TestCas */ public function testSetValueThrowsExceptionIfArrayAccessExpected() { - $this->propertyAccessor->setValue(new \stdClass(), '[firstName]', 'Bernhard'); + $object = new \stdClass(); + + $this->propertyAccessor->setValue($object, '[firstName]', 'Bernhard'); } public function testSetValueCallsAdderAndRemoverForCollections() diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php index 6e1a5ed3dc..a06497c774 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php @@ -311,7 +311,9 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase */ public function testSetValueThrowsExceptionIfGetterIsNotPublic() { - $this->propertyAccessor->setValue(new Author(), 'privateSetter', 'foobar'); + $object = new Author(); + + $this->propertyAccessor->setValue($object, 'privateSetter', 'foobar'); } /** @@ -414,7 +416,9 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase */ public function testThrowTypeError() { - $this->propertyAccessor->setValue(new TypeHinted(), 'date', 'This is a string, \DateTime expected.'); + $object = new TypeHinted(); + + $this->propertyAccessor->setValue($object, 'date', 'This is a string, \DateTime expected.'); } public function testSetTypeHint()