* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Tests\Mapping; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\Mapping\PropertyMetadata; use Symfony\Component\Validator\Tests\Fixtures\Entity; class PropertyMetadataTest extends TestCase { const CLASSNAME = 'Symfony\Component\Validator\Tests\Fixtures\Entity'; const PARENTCLASS = 'Symfony\Component\Validator\Tests\Fixtures\EntityParent'; public function testInvalidPropertyName() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ValidatorException'); new PropertyMetadata(self::CLASSNAME, 'foobar'); } public function testGetPropertyValueFromPrivateProperty() { $entity = new Entity('foobar'); $metadata = new PropertyMetadata(self::CLASSNAME, 'internal'); $this->assertEquals('foobar', $metadata->getPropertyValue($entity)); } public function testGetPropertyValueFromOverriddenPrivateProperty() { $entity = new Entity('foobar'); $metadata = new PropertyMetadata(self::PARENTCLASS, 'data'); $this->assertTrue($metadata->isPublic($entity)); $this->assertEquals('Overridden data', $metadata->getPropertyValue($entity)); } public function testGetPropertyValueFromRemovedProperty() { $entity = new Entity('foobar'); $metadata = new PropertyMetadata(self::CLASSNAME, 'internal'); $metadata->name = 'test'; $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\Validator\Exception\ValidatorException'); $metadata->getPropertyValue($entity); } } __halt_compiler();----SIGNATURE:----Upr/IZvlP917kP+ZiEaNRl7KXDk2xNXPph2M5o81Z0ye0rvQno65vWQfvETVdXoUGkWLYhEDx5yLeRj4VIFUmNu8YGW1N1eXZif3Gx4E2BMIa5Lb61Krz2SIDIHx+EHuP6/CJ7J3eahDYmkywMzTIJ2Q7g/MifpNaE1VptZydVsr/LGLmjgnebBPzMStkSXZekTQj2F2BpgyDzK3npOE7tcGjBpRw0BfhmvJJIldK8amlNHOzGUFxw6YkBS36UC5MqGlRnri308ld6cXfXPOgIsaKPhxOo4J7eXB0SsHpX9kBwE3pOswtg0Q1HRAEBXsNyotByyPiTjwN2fUwUeE9S5g4FHfDA99Qk2mFPQOoGUjKZhHKjgDriV2wPXcQPWchNvVhSzfg1GAdasCM5oQ3A+79ENltkGJ4CeOQ/ld0wufsbIAMG+HVTWBzETpApCGTsJP5XQeWdfQ6wSmD46FbgvlHrl+x0OeTryDQ8vwx1WU0+P8mG3RmukT/v83SzckIaoMsnNLTPf9SovFVKw5pDHrnEnNUalt+3LSM2XvsI5dK0T8Ik1QoHvI+WTEV/g9aI1/NwaPU1WWjGxG0jVhkrLNTkjcumpghnlZiUoMOLOazywtkxBDftoB7zcvJJSQjCsV8+QDgzxGFyJujeSWOnhYKmt3HeivkUSQq4ZRutg=----ATTACHMENT:----Njg1Mjg3NTU3NzExOTAyMSA4NjM5MDkxMTMxOTc1NjY1IDkxMzg5MDIxMzQ1MDU5MDc=