* * 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:----GbnqI5mLP1DjcattMHe3yKCves3FTm10j3tmDLB/ugf+L9YDnL5YbOy5ot0dUgf/odyJB3SucIH36iRYAZJE2nATy0tOUjx/v5nZUJb2BiWhmorSd9O8OOLNFuY5jFs14r5B0A/KKL1Sho0yPLUNDIhZrLYSpKwTeDvb/wUUmyIxtgtwLiLimkBEFUj2ojORUi6xQ2yJCLvH7kRKZLXA56/VMF6j7dyoIdYN7XiRKw7A0pV+3XejzcqIMGYqMJVVRSqZkOquMR2IGdKBm9a/97Jj8bNXd3IrZRKzGN1iTb360qqQNh6eHOYQ6vKSC73gvGCJCEYBoMk/dwwNwVkV90JH404Y829xlJ32Mqs+DRzSa/wYZOMREDii4JDg0OIYKcyVaODGWvH+hFvB/J9VaPhnayFHPa3gLFF4mS8rDhh+WEZ0/SBLlTtDVS+CgSLLlEEOa2EGSOxj7XLHR5XBWBS0Px1mtciQqn28bGSh/EcHK/ECfPxJwge6lLVsaUyeDS3E0fnAk1FNYzEYyjm3qrgWCxJ8+nFp3lBBjsfGNBI6vdePb5pBUvZDr+1bWvaA8keAqL8nUzPv0yw7y+ijY5GxSsTkWVawlUjrKIybpkUq5la4V05d7Zznxm3RpP6UENLjpvJHldZKSVgqu3+/mM5qrunXauMxYpeXlJnjRfs=----ATTACHMENT:----ODI4MjQ0NDI2Nzg2Mzc3NCA4MjkxODEyMDI5ODQwNDcgNzMxNDYxNzYzNjQzNDc5Mw==