コード例 #1
0
 /**
  * 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');
 }
コード例 #2
0
 /**
  * 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');
 }