validatePropertyValue() public method

{@inheritDoc}
public validatePropertyValue ( $class, $property, $value, $groups = null )
Example #1
0
 /**
  * @expectedException \Symfony\Component\Validator\Exception\ValidatorException
  */
 public function testValidatePropertyValueFailsIfPropertiesNotSupported()
 {
     // $metadata does not implement PropertyMetadataContainerInterface
     $metadata = $this->getMock('Symfony\\Component\\Validator\\MetadataInterface');
     $this->metadataFactory = $this->getMock('Symfony\\Component\\Validator\\MetadataFactoryInterface');
     $this->metadataFactory->expects($this->any())->method('getMetadataFor')->with('VALUE')->will($this->returnValue($metadata));
     $this->validator = new Validator($this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator());
     $this->validator->validatePropertyValue('VALUE', 'someProperty', 'propertyValue');
 }