protected function LatestRevisionCheckTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php \Drupal\Tests\content_moderation\Unit\LatestRevisionCheckTest::setUp()
- 9 core/modules/content_moderation/tests/src/Unit/LatestRevisionCheckTest.php \Drupal\Tests\content_moderation\Unit\LatestRevisionCheckTest::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);
}