public function GroupContentAccessControlHandlerTest::setUp in Group 8
Same name and namespace in other branches
- 2.0.x tests/src/Unit/GroupContentAccessControlHandlerTest.php \Drupal\Tests\group\Unit\GroupContentAccessControlHandlerTest::setUp()
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ GroupContentAccessControlHandlerTest.php, line 42
Class
- GroupContentAccessControlHandlerTest
- Tests the default GroupContentEnabler access handler.
Namespace
Drupal\Tests\group\UnitCode
public function setUp() {
parent::setUp();
$cache_context_manager = $this
->prophesize(CacheContextsManager::class);
$cache_context_manager
->assertValidTokens(Argument::any())
->willReturn(TRUE);
$entity_type_manager = $this
->prophesize(EntityTypeManagerInterface::class);
$this->container = $this
->prophesize(ContainerInterface::class);
$this->container
->get('cache_contexts_manager')
->willReturn($cache_context_manager
->reveal());
$this->container
->get('entity_type.manager')
->willReturn($entity_type_manager
->reveal());
\Drupal::setContainer($this->container
->reveal());
}