function ViewsTest::setUp
Same name in other branches
- 9 core/modules/views/tests/src/Unit/ViewsTest.php \Drupal\Tests\views\Unit\ViewsTest::setUp()
- 8.9.x core/modules/views/tests/src/Unit/ViewsTest.php \Drupal\Tests\views\Unit\ViewsTest::setUp()
- 11.x core/modules/views/tests/src/Unit/ViewsTest.php \Drupal\Tests\views\Unit\ViewsTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ views/ tests/ src/ Unit/ ViewsTest.php, line 33
Class
- ViewsTest
- @coversDefaultClass \Drupal\views\Views @group views
Namespace
Drupal\Tests\views\UnitCode
protected function setUp() : void {
parent::setUp();
$this->container = new ContainerBuilder();
$user = $this->createMock('Drupal\\Core\\Session\\AccountInterface');
$request_stack = new RequestStack();
$request_stack->push(new Request());
$views_data = $this->getMockBuilder('Drupal\\views\\ViewsData')
->disableOriginalConstructor()
->getMock();
$route_provider = $this->createMock('Drupal\\Core\\Routing\\RouteProviderInterface');
$display_plugin_manager = $this->getMockBuilder('\\Drupal\\views\\Plugin\\ViewsPluginManager')
->disableOriginalConstructor()
->getMock();
$this->container
->set('views.executable', new ViewExecutableFactory($user, $request_stack, $views_data, $route_provider, $display_plugin_manager));
\Drupal::setContainer($this->container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.