/** * Cannot be UnsupportedMetadataException for BC with Symfony < 2.5. * * @expectedException \Symfony\Component\Validator\Exception\ValidatorException */ public function testValidatePropertyValueFailsIfPropertiesNotSupported() { // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\\Component\\Validator\\MetadataInterface'); $this->metadataFactory->addMetadataForValue('VALUE', $metadata); $this->validatePropertyValue('VALUE', 'someProperty', 'someValue'); }
/** * Cannot be UnsupportedMetadataException for BC with Symfony < 2.5. * * @expectedException \Symfony\Component\Validator\Exception\ValidatorException * @group legacy */ public function testLegacyValidatePropertyValueFailsIfPropertiesNotSupported() { $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); // $metadata does not implement PropertyMetadataContainerInterface $metadata = $this->getMock('Symfony\\Component\\Validator\\MetadataInterface'); $this->metadataFactory->addMetadataForValue('VALUE', $metadata); $this->validatePropertyValue('VALUE', 'someProperty', 'someValue'); }