protected function BundleEntityAccessControlHandlerTest::setUp in Entity API 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ BundleEntityAccessControlHandlerTest.php, line 27
Class
- BundleEntityAccessControlHandlerTest
- @coversDefaultClass \Drupal\entity\BundleEntityAccessControlHandler @group entity
Namespace
Drupal\Tests\entity\UnitCode
protected function setUp() {
parent::setUp();
$module_handler = $this
->prophesize(ModuleHandlerInterface::class);
$module_handler
->invokeAll(Argument::any(), Argument::any())
->willReturn([]);
$cache_contexts_manager = $this
->prophesize(CacheContextsManager::class);
$cache_contexts_manager
->assertValidTokens(Argument::any())
->willReturn(TRUE);
$container = new ContainerBuilder();
$container
->set('module_handler', $module_handler
->reveal());
$container
->set('cache_contexts_manager', $cache_contexts_manager
->reveal());
\Drupal::setContainer($container);
}