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\ValueCode
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);
}