Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CompoundConstraintTestCase.php

function CompoundConstraintTestCase::createContext

2 calls to CompoundConstraintTestCase::createContext()
CompoundConstraintTestCase::assertViolationsRaisedByCompound in vendor/symfony/validator/Test/CompoundConstraintTestCase.php
CompoundConstraintTestCase::setUp in vendor/symfony/validator/Test/CompoundConstraintTestCase.php
This method is called before each test.

File

vendor/symfony/validator/Test/CompoundConstraintTestCase.php, line 59

Class

CompoundConstraintTestCase
A test case to ease testing Compound Constraints.

Namespace

Symfony\Component\Validator\Test

Code

protected function createContext(?ValidatorInterface $validator = null) : ExecutionContextInterface {
    $translator = $this->createMock(TranslatorInterface::class);
    $translator->expects($this->any())
        ->method('trans')
        ->willReturnArgument(0);
    return new ExecutionContext($validator ?? $this->createValidator(), $this->root, $translator);
}
RSS feed
Powered by Drupal