use Symfony\Component\Validator\Mapping\GetterMetadata;
use Symfony\Component\Validator\Tests\Fixtures\NestedAttribute\Entity;
class GetterMetadataTest extends TestCase
{ private const CLASSNAME = Entity::
class;
public function testInvalidPropertyName() { $this->
expectException(ValidatorException::
class);
new GetterMetadata(self::CLASSNAME, 'foobar'
);
} public function testGetPropertyValueFromPublicGetter() { $entity =
new Entity('foobar'
);
$metadata =
new GetterMetadata(self::CLASSNAME, 'internal'
);
$this->
assertEquals('foobar from getter',
$metadata->
getPropertyValue($entity));
} public function testGetPropertyValueFromOverriddenPublicGetter() {