protected function MenuLinkFormatterTest::installSchema in Menu Link (Field) 8
Installs database tables from a module schema definition.
Parameters
string $module: The name of the module that defines the table's schema.
string|array $tables: The name or an array of the names of the tables to install.
Throws
\LogicException If $module is not enabled or the table schema cannot be found.
Overrides KernelTestBase::installSchema
File
- tests/
src/ Kernel/ MenuLinkFormatterTest.php, line 58
Class
- MenuLinkFormatterTest
- Tests the menu link field formatters.
Namespace
Drupal\Tests\menu_link\KernelCode
protected function installSchema($module, $tables) : void {
$this
->installEntitySchema('user');
$this
->installEntitySchema('entity_test_mul');
FieldStorageConfig::create([
'field_name' => 'field_menu_link',
'entity_type' => 'entity_test_mul',
'type' => 'menu_link',
])
->save();
FieldConfig::create([
'field_name' => 'field_menu_link',
'entity_type' => 'entity_test_mul',
'bundle' => 'entity_test_mul',
])
->save();
}