Skip to content

Commit a125af7

Browse files
[PropertyAccess] Fix for PHP 7.0.7
1 parent c59a3da commit a125af7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ public function testSetValueUpdatesNestedArrayAccess()
173173
*/
174174
public function testSetValueThrowsExceptionIfArrayAccessExpected()
175175
{
176-
$this->propertyAccessor->setValue(new \stdClass(), '[firstName]', 'Bernhard');
176+
$object = new \stdClass();
177+
178+
$this->propertyAccessor->setValue($object, '[firstName]', 'Bernhard');
177179
}
178180

179181
public function testSetValueCallsAdderAndRemoverForCollections()

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ public function testSetValueCamelizesSetterNames()
311311
*/
312312
public function testSetValueThrowsExceptionIfGetterIsNotPublic()
313313
{
314-
$this->propertyAccessor->setValue(new Author(), 'privateSetter', 'foobar');
314+
$object = new Author();
315+
316+
$this->propertyAccessor->setValue($object, 'privateSetter', 'foobar');
315317
}
316318

317319
/**
@@ -414,7 +416,9 @@ public function getValidPropertyPaths()
414416
*/
415417
public function testThrowTypeError()
416418
{
417-
$this->propertyAccessor->setValue(new TypeHinted(), 'date', 'This is a string, \DateTime expected.');
419+
$object = new TypeHinted();
420+
421+
$this->propertyAccessor->setValue($object, 'date', 'This is a string, \DateTime expected.');
418422
}
419423

420424
public function testSetTypeHint()

0 commit comments

Comments
 (0)