function ContextMapperTest::setUp

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/ContextMapperTest.php \Drupal\Tests\ctools\Unit\ContextMapperTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/ContextMapperTest.php, line 46

Class

ContextMapperTest
@coversDefaultClass <a href="/api/ctools/src%21ContextMapper.php/class/ContextMapper/8.x-3.x" title="Maps context configurations to context objects." class="local">\Drupal\ctools\ContextMapper</a>

Namespace

Drupal\Tests\ctools\Unit

Code

protected function setUp() : void {
    parent::setUp();
    $this->typedDataManager = $this->prophesize(TypedDataManager::class);
    $this->entityRepository = $this->prophesize(EntityRepositoryInterface::class);
    $this->staticContext = new ContextMapper($this->entityRepository
        ->reveal());
    $container = new ContainerBuilder();
    $container->set('typed_data_manager', $this->typedDataManager
        ->reveal());
    \Drupal::setContainer($container);
}