You are here

protected function FieldNormalizerValueTest::setUp in JSON:API 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/Normalizer/Value/FieldNormalizerValueTest.php, line 30

Class

FieldNormalizerValueTest
@coversDefaultClass \Drupal\jsonapi\Normalizer\Value\FieldNormalizerValue @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Normalizer\Value

Code

protected function setUp() {
  parent::setUp();
  $this->cacheContextsManager = $this
    ->getMockBuilder('Drupal\\Core\\Cache\\Context\\CacheContextsManager')
    ->disableOriginalConstructor()
    ->getMock();
  $this->cacheContextsManager
    ->method('assertValidTokens')
    ->willReturn(TRUE);
  $container = new ContainerBuilder();
  $container
    ->set('cache_contexts_manager', $this->cacheContextsManager);
  \Drupal::setContainer($container);
}