function LatestRevisionCheckTest::setUp
Same name in other branches
- 8.9.x core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php \Drupal\Tests\content_moderation\Unit\LatestRevisionCheckTest::setUp()
- 10 core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php \Drupal\Tests\content_moderation\Unit\LatestRevisionCheckTest::setUp()
- 11.x core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php \Drupal\Tests\content_moderation\Unit\LatestRevisionCheckTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ content_moderation/ tests/ src/ Unit/ LatestRevisionCheckTest.php, line 30
Class
- LatestRevisionCheckTest
- @coversDefaultClass \Drupal\content_moderation\Access\LatestRevisionCheck @group content_moderation
Namespace
Drupal\Tests\content_moderation\UnitCode
protected function setUp() : void {
parent::setUp();
// Initialize Drupal container since the cache context manager is needed.
$contexts_manager = $this->prophesize(CacheContextsManager::class);
$contexts_manager->assertValidTokens(Argument::any())
->willReturn(TRUE);
$builder = new ContainerBuilder();
$builder->set('cache_contexts_manager', $contexts_manager->reveal());
\Drupal::setContainer($builder);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.