function FilterBooleanOperatorGroupTest::setUp
Same name in other branches
- 10 core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorGroupTest.php \Drupal\Tests\views\Kernel\Handler\FilterBooleanOperatorGroupTest::setUp()
- 11.x core/modules/views/tests/src/Kernel/Handler/FilterBooleanOperatorGroupTest.php \Drupal\Tests\views\Kernel\Handler\FilterBooleanOperatorGroupTest::setUp()
Overrides ViewsKernelTestBase::setUp
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ FilterBooleanOperatorGroupTest.php, line 46
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',
]);
$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.