function EntityLinksTest::setUp
Overrides KernelTestBase::setUp
File
-
core/
modules/ filter/ tests/ src/ Kernel/ EntityLinksTest.php, line 81
Class
- EntityLinksTest
- Tests the behavior of generating entity URLs when using entity links in CKEditor.
Namespace
Drupal\Tests\filter\KernelCode
protected function setUp() : void {
parent::setUp();
$this->installConfig('system');
// @see ::test
$this->installEntitySchema('entity_test');
$this->installEntitySchema('entity_test_mul');
$this->installEntitySchema('path_alias');
// @see ::testFileEntity
// @see ::testMediaEntity
$this->installEntitySchema('file');
// @see ::testMediaEntity
$this->installEntitySchema('media');
$this->installEntitySchema('media_type');
$this->installEntitySchema('field_storage_config');
$this->installEntitySchema('field_config');
$this->installEntitySchema('user');
$this->installSchema('file', [
'file_usage',
]);
$this->installConfig([
'media',
]);
// @see ::testMenuLinkContentEntity
$this->installEntitySchema('menu_link_content');
// @see ::testShortcutEntity
$this->installEntitySchema('shortcut');
$this->installConfig([
'shortcut',
]);
// Add Swedish, Danish and Finnish.
ConfigurableLanguage::createFromLangcode('sv')->save();
ConfigurableLanguage::createFromLangcode('da')->save();
ConfigurableLanguage::createFromLangcode('fi')->save();
/** @var \Drupal\Component\Plugin\PluginManagerInterface $manager */
$manager = $this->container
->get('plugin.manager.filter');
$bag = new FilterPluginCollection($manager, []);
$this->filter = $bag->get('entity_links');
// Add test logger to the 'filter' channel to assert no exceptions occurred.
$this->logger = new TestLogger();
$this->container
->get('logger.factory')
->get('filter')
->addLogger($this->logger);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.