Symfony\Component\Validator\ExecutionContext::getMetadataFactory PHP Method

getMetadataFactory() public method

public getMetadataFactory ( ) : Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface
return Symfony\Component\Validator\Mapping\ClassMetadataFactoryInterface
    public function getMetadataFactory()
    {
        return $this->metadataFactory;
    }

Usage Example

 public function testInit()
 {
     $this->assertCount(0, $this->context->getViolations());
     $this->assertSame('Root', $this->context->getRoot());
     $this->assertSame('foo.bar', $this->context->getPropertyPath());
     $this->assertSame('Group', $this->context->getGroup());
     $this->visitor->expects($this->once())->method('getGraphWalker')->will($this->returnValue('GRAPHWALKER'));
     // BC
     set_error_handler(array($this, "deprecationErrorHandler"));
     $this->assertNull($this->context->getCurrentClass());
     $this->assertNull($this->context->getCurrentProperty());
     $this->assertSame('GRAPHWALKER', $this->context->getGraphWalker());
     $this->assertSame($this->metadataFactory, $this->context->getMetadataFactory());
     restore_error_handler();
 }