Skip to content

Commit b576fe1

Browse files
minor symfony#18906 [PropertyAccess] Fix for PHP 7.0.7 (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [PropertyAccess] Fix for PHP 7.0.7 | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is what break travis currently. See https://3v4l.org/r37rY Commits ------- a125af7 [PropertyAccess] Fix for PHP 7.0.7
2 parents c59a3da + a125af7 commit b576fe1

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)