Commit ef3190f7 authored by catch's avatar catch
Browse files

Issue #3157954 by alexpott, andypost: Remove unnecessary route rebuild from tests

parent 959b5e1f
......@@ -43,8 +43,6 @@ protected function setUp(): void {
$this->installEntitySchema('aggregator_feed');
$this->installEntitySchema('aggregator_item');
\Drupal::service('router.builder')->rebuild();
$this->fieldName = 'title';
}
......
......@@ -25,7 +25,6 @@ public function testCacheTagInvalidationUponInstallation() {
// Install the block module, and place the "Powered by Drupal" block.
$this->container->get('module_installer')->install(['block', 'shortcut']);
$this->rebuildContainer();
$this->container->get('router.builder')->rebuild();
$this->drupalPlaceBlock('system_powered_by_block');
// Check the same page, block.module's hook_install() should have
......
......@@ -281,7 +281,6 @@ public function testThemeName() {
// Explicitly set the default and admin themes.
$theme = 'block_test_specialchars_theme';
\Drupal::service('theme_installer')->install([$theme]);
\Drupal::service('router.builder')->rebuild();
$this->drupalGet('admin/structure/block');
$this->assertEscaped('<"Cat" & \'Mouse\'>');
$this->drupalGet('admin/structure/block/list/block_test_specialchars_theme');
......
......@@ -202,7 +202,6 @@ public function testsBlockContentAddTypes() {
// Change the default theme.
$theme_settings->set('default', $default_theme)->save();
$this->drupalPlaceBlock('local_actions_block');
\Drupal::service('router.builder')->rebuild();
// For each installed theme, go to its block page and test the redirects.
foreach (['bartik', 'seven', 'stark'] as $theme) {
......
......@@ -134,9 +134,6 @@ public function testCommentFieldLinksNonDefaultName() {
// \Drupal\comment\CommentLinkBuilder::buildCommentedEntityLinks. Therefore
// we need a node listing, let's use views for that.
$this->container->get('module_installer')->install(['views'], TRUE);
// We also need a router rebuild, as the router is lazily rebuild in the
// module installer.
\Drupal::service('router.builder')->rebuild();
$this->drupalGet('node');
$link_info = $this->getDrupalSettings()['comment']['newCommentsLinks']['node']['comment2']['2'];
......
......@@ -54,9 +54,6 @@ protected function setUp(): void {
$this->installSchema('comment', ['comment_entity_statistics']);
$this->installConfig(['system', 'filter', 'comment']);
// Comment rendering generates links, so build the router.
$this->container->get('router.builder')->rebuild();
// Set up a field, so that the entity that'll be referenced bubbles up a
// cache tag when rendering it entirely.
$this->addDefaultCommentField('entity_test', 'entity_test');
......
......@@ -39,9 +39,6 @@ protected function setUp(): void {
$this->installSchema('node', ['node_access']);
$this->installConfig(['comment']);
// The entity.node.canonical route must exist when the RDF hook is called.
$this->container->get('router.builder')->rebuild();
$this->migrateContent();
$this->executeMigrations([
'language',
......
......@@ -61,8 +61,6 @@ protected function setUp(): void {
// picked up.
\Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE);
\Drupal::service('router.builder')->rebuild();
$this->baseUser1 = $this->drupalCreateUser(['access content overview']);
$this->baseUser2 = $this->drupalCreateUser([
'access content overview',
......
......@@ -168,8 +168,6 @@ protected function enableTranslation() {
// Enable translation for the current entity type and ensure the change is
// picked up.
\Drupal::service('content_translation.manager')->setEnabled($this->entityTypeId, $this->bundle, TRUE);
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -79,7 +79,6 @@ protected function setUp(): void {
$type->save();
node_add_body_field($type);
$this->installEntitySchema('user');
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -229,8 +229,6 @@ protected function enableTranslation() {
// up.
\Drupal::service('content_translation.manager')->setEnabled($this->testEntityTypeName, $this->referrerType->id(), TRUE);
\Drupal::service('content_translation.manager')->setEnabled($this->testEntityTypeName, $this->referencedType->id(), TRUE);
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -74,9 +74,6 @@ protected function setUp(): void {
->grantPermission('view test entity')
->save();
// The label formatter rendering generates links, so build the router.
$this->container->get('router.builder')->rebuild();
$this->createEntityReferenceField($this->entityType, $this->bundle, $this->fieldName, 'Field test', $this->entityType, 'default', [], FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
// Set up a field, so that the entity that'll be referenced bubbles up a
......
......@@ -15,7 +15,6 @@ class FieldAttachOtherTest extends FieldKernelTestBase {
protected function setUp(): void {
parent::setUp();
$this->container->get('router.builder')->rebuild();
$this->installEntitySchema('entity_test_rev');
$this->createFieldWithStorage();
}
......
......@@ -58,7 +58,6 @@ protected function setUp(): void {
// Configure the theme system.
$this->installConfig(['system', 'field']);
\Drupal::service('router.builder')->rebuild();
$this->installEntitySchema('entity_test');
$this->entityType = 'entity_test';
......
......@@ -66,7 +66,6 @@ protected function setUp(): void {
// Configure the theme system.
$this->installConfig(['system', 'field']);
\Drupal::service('router.builder')->rebuild();
$this->installEntitySchema('entity_test_rev');
$this->entityType = 'entity_test_rev';
......
......@@ -27,7 +27,6 @@ protected function setUp(): void {
parent::setUp();
$this->installConfig(['system', 'field']);
\Drupal::service('router.builder')->rebuild();
$this->installEntitySchema('entity_test');
}
......
......@@ -44,8 +44,6 @@ protected function setUp(): void {
$this->installEntitySchema('user');
$this->installSchema('system', ['sequences']);
$this->installConfig(['filter', 'filter_test']);
// Filter tips link to the full-page.
\Drupal::service('router.builder')->rebuild();
/* @var \Drupal\Core\Render\ElementInfoManager $manager */
$manager = \Drupal::service('plugin.manager.element_info');
$manager->clearCachedDefinitions();
......
......@@ -50,8 +50,6 @@ protected function setUp(): void {
'bundle' => 'page',
'field_name' => 'field_ref',
])->save();
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -40,8 +40,6 @@ protected function setUp(): void {
],
],
])->save();
\Drupal::service('router.builder')->rebuild();
}
/**
......
......@@ -76,7 +76,6 @@ protected function setUp() {
$class = get_parent_class($class);
}
$this->installConfig(['field', 'language']);
\Drupal::service('router.builder')->rebuild();
// Add German as a language.
ConfigurableLanguage::create([
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment