Skip to content

Commit 405b881

Browse files
committed
minor symfony#12964 [PropertyAccess] Added test to verify symfony#5775 is fixed (aboks)
This PR was merged into the 2.3 branch. Discussion ---------- [PropertyAccess] Added test to verify symfony#5775 is fixed | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#5775 | License | MIT | Doc PR | Added regression test to verify symfony#5775 has been fixed some time ago, so that it can be closed. Commits ------- 45651c6 [PropertyAccess] Added test to verify symfony#5775 is fixed
2 parents 1bb837e + 45651c6 commit 405b881

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
13+
14+
class Ticket5775Object
15+
{
16+
private $property;
17+
18+
public function getProperty()
19+
{
20+
return $this->property;
21+
}
22+
23+
private function setProperty()
24+
{
25+
}
26+
27+
public function __set($property, $value)
28+
{
29+
$this->$property = $value;
30+
}
31+
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\PropertyAccess\Tests\Fixtures\Author;
1616
use Symfony\Component\PropertyAccess\Tests\Fixtures\Magician;
1717
use Symfony\Component\PropertyAccess\Tests\Fixtures\MagicianCall;
18+
use Symfony\Component\PropertyAccess\Tests\Fixtures\Ticket5775Object;
1819

1920
class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
2021
{
@@ -379,4 +380,13 @@ public function testSetValueUpdatesMagicCall()
379380

380381
$this->assertEquals('foobar', $object->getMagicProperty());
381382
}
383+
384+
public function testTicket5755()
385+
{
386+
$object = new Ticket5775Object();
387+
388+
$this->propertyAccessor->setValue($object, 'property', 'foobar');
389+
390+
$this->assertEquals('foobar', $object->getProperty());
391+
}
382392
}

0 commit comments

Comments
 (0)