You are here

protected function LegacyExecutionContextTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/LegacyExecutionContextTest.php \Symfony\Component\Validator\Tests\LegacyExecutionContextTest::setUp()

File

vendor/symfony/validator/Tests/LegacyExecutionContextTest.php, line 42

Class

LegacyExecutionContextTest
@group legacy

Namespace

Symfony\Component\Validator\Tests

Code

protected function setUp() {
  $this->visitor = $this
    ->getMockBuilder('Symfony\\Component\\Validator\\ValidationVisitor')
    ->disableOriginalConstructor()
    ->getMock();
  $this->violations = new ConstraintViolationList();
  $this->metadata = $this
    ->getMock('Symfony\\Component\\Validator\\MetadataInterface');
  $this->metadataFactory = $this
    ->getMock('Symfony\\Component\\Validator\\MetadataFactoryInterface');
  $this->globalContext = $this
    ->getMock('Symfony\\Component\\Validator\\GlobalExecutionContextInterface');
  $this->globalContext
    ->expects($this
    ->any())
    ->method('getRoot')
    ->will($this
    ->returnValue('Root'));
  $this->globalContext
    ->expects($this
    ->any())
    ->method('getViolations')
    ->will($this
    ->returnValue($this->violations));
  $this->globalContext
    ->expects($this
    ->any())
    ->method('getVisitor')
    ->will($this
    ->returnValue($this->visitor));
  $this->globalContext
    ->expects($this
    ->any())
    ->method('getMetadataFactory')
    ->will($this
    ->returnValue($this->metadataFactory));
  $this->translator = $this
    ->getMock('Symfony\\Component\\Translation\\TranslatorInterface');
  $this->context = new ExecutionContext($this->globalContext, $this->translator, self::TRANS_DOMAIN, $this->metadata, 'currentValue', 'Group', 'foo.bar');
}