function ContextualFiltersBlockContextTest::setUp
Same name in other branches
- 9 core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php \Drupal\Tests\views\Functional\Plugin\ContextualFiltersBlockContextTest::setUp()
- 10 core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php \Drupal\Tests\views\Functional\Plugin\ContextualFiltersBlockContextTest::setUp()
- 11.x core/modules/views/tests/src/Functional/Plugin/ContextualFiltersBlockContextTest.php \Drupal\Tests\views\Functional\Plugin\ContextualFiltersBlockContextTest::setUp()
Overrides ViewTestBase::setUp
File
-
core/
modules/ views/ tests/ src/ Functional/ Plugin/ ContextualFiltersBlockContextTest.php, line 55
Class
- ContextualFiltersBlockContextTest
- A test for contextual filters exposed as block context.
Namespace
Drupal\Tests\views\Functional\PluginCode
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
ViewTestData::createTestViews(get_class($this), [
'block_test_views',
]);
$this->enableViewsTestModule();
$this->nodeType = $this->container
->get('entity_type.manager')
->getStorage('node_type')
->create([
'name' => 'Test node type',
'type' => 'test',
]);
$this->nodeType
->save();
$this->nodes[0] = $this->container
->get('entity_type.manager')
->getStorage('node')
->create([
'type' => $this->nodeType
->id(),
'title' => 'First test node',
]);
$this->nodes[0]
->save();
$this->nodes[1] = $this->container
->get('entity_type.manager')
->getStorage('node')
->create([
'type' => $this->nodeType
->id(),
'title' => 'Second test node',
]);
$this->nodes[1]
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.