protected function OptionsTestBase::mockStandardInstall in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/options/src/Tests/Views/OptionsTestBase.php \Drupal\options\Tests\Views\OptionsTestBase::mockStandardInstall()
Provides a workaround for the inability to use the standard profile.
See also
https://www.drupal.org/node/1708692
1 call to OptionsTestBase::mockStandardInstall()
- OptionsTestBase::setUp in core/
modules/ options/ src/ Tests/ Views/ OptionsTestBase.php - Performs setup tasks before each individual test method is run.
File
- core/
modules/ options/ src/ Tests/ Views/ OptionsTestBase.php, line 76 - Contains \Drupal\options\Tests\Views\OptionsTestBase.
Class
- OptionsTestBase
- Base class for options views tests.
Namespace
Drupal\options\Tests\ViewsCode
protected function mockStandardInstall() {
$this
->installEntitySchema('user');
$this
->installEntitySchema('node');
NodeType::create([
'type' => 'article',
])
->save();
$this->fieldValues = [
$this
->randomMachineName(),
$this
->randomMachineName(),
];
$this->fieldNames = [
'field_test_list_string',
'field_test_list_integer',
];
// Create two field entities.
FieldStorageConfig::create([
'field_name' => $this->fieldNames[0],
'entity_type' => 'node',
'type' => 'list_string',
'cardinality' => 1,
'settings' => [
'allowed_values' => [
$this->fieldValues[0] => $this->fieldValues[0],
$this->fieldValues[1] => $this->fieldValues[1],
],
],
])
->save();
FieldStorageConfig::create([
'field_name' => $this->fieldNames[1],
'entity_type' => 'node',
'type' => 'list_integer',
'cardinality' => 1,
'settings' => [
'allowed_values' => [
$this->fieldValues[0],
$this->fieldValues[1],
],
],
])
->save();
foreach ($this->fieldNames as $field_name) {
FieldConfig::create([
'field_name' => $field_name,
'entity_type' => 'node',
'label' => 'Test options list field',
'bundle' => 'article',
])
->save();
}
}