Skip to content

Commit 45651c6

Browse files
committed
[PropertyAccess] Added test to verify symfony#5775 is fixed
1 parent e38b8e6 commit 45651c6

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)