function FilterBooleanOperatorGroupTest::setUp
Same name and namespace in other branches
- 9 core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorGroupTest.php \Drupal\Tests\views\Kernel\Handler\FilterBooleanOperatorGroupTest::setUp()
- 10 core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorGroupTest.php \Drupal\Tests\views\Kernel\Handler\FilterBooleanOperatorGroupTest::setUp()
Parameters
bool $import_test_views: Should the views specified on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.
Overrides ViewsKernelTestBase::setUp
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ FilterBooleanOperatorGroupTest.php, line 44
Class
- FilterBooleanOperatorGroupTest
- Tests the core Drupal\views\Plugin\views\filter\BooleanOperator handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function setUp($import_test_views = TRUE) : void {
parent::setUp($import_test_views);
$this->installEntitySchema('node');
$this->installEntitySchema('user');
$this->installSchema('node', [
'node_access',
]);
$this->installConfig([
'node',
]);
$node_type = NodeType::create([
'type' => 'page',
'name' => 'Page',
]);
$node_type->setDisplaySubmitted(FALSE);
$node_type->save();
FieldStorageConfig::create([
'entity_type' => 'node',
'type' => 'boolean',
'field_name' => 'field_test_boolean_field',
])->save();
FieldConfig::create([
'entity_type' => 'node',
'bundle' => 'page',
'field_name' => 'field_test_boolean_field',
])->save();
Node::create([
'title' => 'Checked',
'type' => 'page',
'field_test_boolean_field' => 1,
'status' => TRUE,
])->save();
Node::create([
'title' => 'Un-checked',
'type' => 'page',
'field_test_boolean_field' => 0,
'status' => TRUE,
])->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.