Issue #3157954 by alexpott, andypost: Remove unnecessary route rebuild from tests
parent
959b5e1f11
commit
ef3190f75a
|
@ -43,8 +43,6 @@ class AggregatorTitleTest extends KernelTestBase {
|
|||
$this->installEntitySchema('aggregator_feed');
|
||||
$this->installEntitySchema('aggregator_item');
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->fieldName = 'title';
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ class BlockInstallTest extends BrowserTestBase {
|
|||
// 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 @@ class BlockTest extends BlockTestBase {
|
|||
// 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 @@ class BlockContentTypeTest extends BlockContentTestBase {
|
|||
// 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 @@ class CommentFieldsTest extends CommentTestBase {
|
|||
// \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 @@ class CommentDefaultFormatterCacheTagsTest extends EntityKernelTestBase {
|
|||
$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 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
|
|||
$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 @@ class ContentTranslationOperationsTest extends NodeTestBase {
|
|||
// 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 @@ abstract class ContentTranslationTestBase extends BrowserTestBase {
|
|||
// 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 @@ class EditorImageDialogTest extends EntityKernelTestBase {
|
|||
$type->save();
|
||||
node_add_body_field($type);
|
||||
$this->installEntitySchema('user');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -229,8 +229,6 @@ class EntityReferenceFieldTranslatedReferenceViewTest extends BrowserTestBase {
|
|||
// 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 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
|
|||
->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 @@ class RawStringFormatterTest extends KernelTestBase {
|
|||
|
||||
// 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 @@ class StringFormatterTest extends KernelTestBase {
|
|||
|
||||
// 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 @@ class UuidFormatterTest extends KernelTestBase {
|
|||
parent::setUp();
|
||||
|
||||
$this->installConfig(['system', 'field']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->installEntitySchema('entity_test');
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,6 @@ class TextFormatElementFormTest extends KernelTestBase implements FormInterface
|
|||
$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 @@ class HalLinkManagerTest extends KernelTestBase {
|
|||
'bundle' => 'page',
|
||||
'field_name' => 'field_ref',
|
||||
])->save();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,8 +40,6 @@ class NormalizeTest extends NormalizerTestBase {
|
|||
],
|
||||
],
|
||||
])->save();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -76,7 +76,6 @@ abstract class NormalizerTestBase extends KernelTestBase {
|
|||
$class = get_parent_class($class);
|
||||
}
|
||||
$this->installConfig(['field', 'language']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Add German as a language.
|
||||
ConfigurableLanguage::create([
|
||||
|
|
|
@ -54,7 +54,6 @@ class LanguageConfigOverrideImportTest extends BrowserTestBase {
|
|||
|
||||
$this->configImporter()->import();
|
||||
$this->rebuildContainer();
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$override = \Drupal::languageManager()->getLanguageConfigOverride('fr', 'system.site');
|
||||
$this->assertEqual('FR default site name', $override->get('name'));
|
||||
|
@ -88,7 +87,6 @@ class LanguageConfigOverrideImportTest extends BrowserTestBase {
|
|||
|
||||
$this->configImporter()->import();
|
||||
$this->rebuildContainer();
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Test that no config save event has been fired during the import because
|
||||
// language configuration overrides do not fire events.
|
||||
|
|
|
@ -36,7 +36,6 @@ class EntityUrlLanguageTest extends LanguageTestBase {
|
|||
|
||||
$this->installEntitySchema('entity_test');
|
||||
$this->installEntitySchema('configurable_language');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// In order to reflect the changes for a multilingual site in the container
|
||||
// we have to rebuild it.
|
||||
|
|
|
@ -267,7 +267,6 @@ class CKEditorIntegrationTest extends WebDriverTestBase {
|
|||
$this->config('node.settings')
|
||||
->set('use_admin_theme', TRUE)
|
||||
->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
// Allow the test user to view the admin theme.
|
||||
$this->adminUser->addRole($this->drupalCreateRole(['view the administration theme']));
|
||||
|
|
|
@ -57,7 +57,6 @@ class MenuLinkContentDeleteFormTest extends BrowserTestBase {
|
|||
$this->assertLinkByHref($menu_link->toUrl('edit-form')->toString());
|
||||
|
||||
\Drupal::service('module_installer')->install(['menu_ui']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Make sure cancel URL points to menu_ui route now.
|
||||
$this->drupalGet($menu_link->toUrl('delete-form'));
|
||||
|
|
|
@ -54,8 +54,6 @@ class MenuLinkContentCacheabilityBubblingTest extends KernelTestBase {
|
|||
* Tests bubbleable metadata of menu links' outbound route/path processing.
|
||||
*/
|
||||
public function testOutboundPathAndRouteProcessing() {
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$request_stack = \Drupal::requestStack();
|
||||
/** @var \Symfony\Component\Routing\RequestContext $request_context */
|
||||
$request_context = \Drupal::service('router.request_context');
|
||||
|
|
|
@ -309,7 +309,6 @@ class MenuLinksTest extends KernelTestBase {
|
|||
*/
|
||||
public function testModuleUninstalledMenuLinks() {
|
||||
\Drupal::service('module_installer')->install(['menu_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
\Drupal::service('plugin.manager.menu.link')->rebuild();
|
||||
$menu_links = $this->menuLinkManager->loadLinksByRoute('menu_test.menu_test');
|
||||
$this->assertCount(1, $menu_links);
|
||||
|
|
|
@ -53,7 +53,6 @@ class MigrateMenuLinkTest extends MigrateDrupal7TestBase {
|
|||
'd7_menu_links',
|
||||
'node_translation_menu_links',
|
||||
]);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -60,8 +60,6 @@ class PathAliasMenuLinkContentTest extends KernelTestBase {
|
|||
* Tests the path aliasing changing.
|
||||
*/
|
||||
public function testPathAliasChange() {
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$path_alias = $this->createPathAlias('/test-page', '/my-blog');
|
||||
$menu_link_content = MenuLinkContent::create([
|
||||
'title' => 'Menu title',
|
||||
|
|
|
@ -259,8 +259,6 @@ class RouteTest extends KernelTestBase {
|
|||
* The route information based on the source link_path.
|
||||
*/
|
||||
protected function doTransform($value) {
|
||||
// Rebuild the routes.
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
$pathValidator = $this->container->get('path.validator');
|
||||
$row = new Row();
|
||||
$migration = $this->prophesize(MigrationInterface::class)->reveal();
|
||||
|
|
|
@ -101,8 +101,6 @@ class NodeLanguageTest extends NodeTestBase {
|
|||
$node->save();
|
||||
}
|
||||
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$user = $this->drupalCreateUser([
|
||||
'access content overview',
|
||||
'access content',
|
||||
|
|
|
@ -51,7 +51,6 @@ abstract class OptionsFieldUnitTestBase extends FieldKernelTestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->fieldStorageDefinition = [
|
||||
'field_name' => $this->fieldName,
|
||||
|
|
|
@ -470,7 +470,6 @@ class PageCacheTest extends BrowserTestBase {
|
|||
// Uninstall the page_cache module to verify that form is immutable
|
||||
// regardless of the internal page cache module.
|
||||
$this->container->get('module_installer')->uninstall(['page_cache']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->drupalGet('page_cache_form_test_immutability');
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ class PathNoCanonicalLinkTest extends KernelTestBase {
|
|||
|
||||
$this->installEntitySchema('entity_test');
|
||||
$this->installEntitySchema('entity_test_mul');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Adding german language.
|
||||
ConfigurableLanguage::create(['id' => 'de'])->save();
|
||||
|
|
|
@ -58,15 +58,6 @@ abstract class FieldRdfaTestBase extends FieldKernelTestBase {
|
|||
*/
|
||||
protected $testValue;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to test the formatter's RDFa.
|
||||
*
|
||||
|
|
|
@ -31,8 +31,6 @@ class EntityResolverTest extends NormalizerTestBase {
|
|||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Create the test field storage.
|
||||
FieldStorageConfig::create([
|
||||
'entity_type' => 'entity_test_mulrev',
|
||||
|
|
|
@ -32,7 +32,6 @@ abstract class NormalizerTestBase extends KernelTestBase {
|
|||
$this->installEntitySchema('entity_test_mulrev');
|
||||
$this->installEntitySchema('user');
|
||||
$this->installConfig(['field']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
\Drupal::moduleHandler()->invoke('rest', 'install');
|
||||
|
||||
// Auto-create a field for testing.
|
||||
|
|
|
@ -32,7 +32,6 @@ class MigrateShortcutSetTest extends MigrateDrupal7TestBase {
|
|||
parent::setUp();
|
||||
$this->installEntitySchema('shortcut');
|
||||
$this->installEntitySchema('menu_link_content');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->executeMigration('d7_shortcut_set');
|
||||
$this->executeMigration('d7_menu');
|
||||
$this->executeMigration('d7_menu_links');
|
||||
|
|
|
@ -32,7 +32,6 @@ class MigrateShortcutSetUsersTest extends MigrateDrupal7TestBase {
|
|||
$this->installEntitySchema('shortcut');
|
||||
$this->installEntitySchema('menu_link_content');
|
||||
$this->installSchema('shortcut', ['shortcut_set_users']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->migrateUsers(FALSE);
|
||||
$this->executeMigration('d7_shortcut_set');
|
||||
$this->executeMigration('d7_menu');
|
||||
|
|
|
@ -32,7 +32,6 @@ class MigrateShortcutTest extends MigrateDrupal7TestBase {
|
|||
parent::setUp();
|
||||
$this->installEntitySchema('shortcut');
|
||||
$this->installEntitySchema('menu_link_content');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->executeMigration('d7_shortcut_set');
|
||||
$this->executeMigration('d7_menu');
|
||||
$this->executeMigration('d7_menu_links');
|
||||
|
|
|
@ -139,7 +139,6 @@ class MenuRouterTest extends BrowserTestBase {
|
|||
$this->assertEqual($menu_link->getPluginId(), 'menu_test.custom', 'Menu links added at hook_menu_links_discovered_alter() obtain the machine name from the $links key.');
|
||||
// Make sure that rebuilding the menu tree does not produce duplicates of
|
||||
// links added by hook_menu_links_discovered_alter().
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->drupalGet('menu-test');
|
||||
$this->assertUniqueText('Custom link', 'Menu links added by hook_menu_links_discovered_alter() do not duplicate after a menu rebuild.');
|
||||
}
|
||||
|
@ -178,7 +177,6 @@ class MenuRouterTest extends BrowserTestBase {
|
|||
*/
|
||||
protected function doTestMenuOnRoute() {
|
||||
\Drupal::service('module_installer')->install(['router_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->resetAll();
|
||||
|
||||
$this->drupalGet('router_test/test2');
|
||||
|
|
|
@ -301,7 +301,6 @@ class RouterTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testRouterUninstallInstall() {
|
||||
\Drupal::service('module_installer')->uninstall(['router_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
try {
|
||||
\Drupal::service('router.route_provider')->getRouteByName('router_test.1');
|
||||
$this->fail('Route was delete on uninstall.');
|
||||
|
@ -311,7 +310,6 @@ class RouterTest extends BrowserTestBase {
|
|||
}
|
||||
// Install the module again.
|
||||
\Drupal::service('module_installer')->install(['router_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$route = \Drupal::service('router.route_provider')->getRouteByName('router_test.1');
|
||||
$this->assertNotNull($route, 'Route exists after module installation');
|
||||
}
|
||||
|
|
|
@ -65,7 +65,6 @@ class TrustedHostsTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testFakeRequests() {
|
||||
$this->container->get('module_installer')->install(['trusted_hosts_test']);
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$host = $this->container->get('request_stack')->getCurrentRequest()->getHost();
|
||||
$settings['settings']['trusted_host_patterns'] = (object) [
|
||||
|
@ -85,7 +84,6 @@ class TrustedHostsTest extends BrowserTestBase {
|
|||
public function testShortcut() {
|
||||
$this->container->get('module_installer')->install(['block', 'shortcut']);
|
||||
$this->rebuildContainer();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
|
||||
$entity_type_manager = $this->container->get('entity_type.manager');
|
||||
|
|
|
@ -16,7 +16,6 @@ class PageRenderTest extends KernelTestBase {
|
|||
*/
|
||||
public function testHookPageAttachmentsExceptions() {
|
||||
$this->enableModules(['common_test', 'system']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments');
|
||||
}
|
||||
|
@ -26,7 +25,6 @@ class PageRenderTest extends KernelTestBase {
|
|||
*/
|
||||
public function testHookPageAlter() {
|
||||
$this->enableModules(['common_test', 'system']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->assertPageRenderHookExceptions('common_test', 'hook_page_attachments_alter');
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ abstract class TokenReplaceKernelTestBase extends EntityKernelTestBase {
|
|||
parent::setUp();
|
||||
// Install default system configuration.
|
||||
$this->installConfig(['system']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->interfaceLanguage = \Drupal::languageManager()->getCurrentLanguage();
|
||||
$this->tokenService = \Drupal::token();
|
||||
|
|
|
@ -104,7 +104,6 @@ class TaxonomyFieldFilterTest extends ViewTestBase {
|
|||
Views::viewsData()->clear();
|
||||
|
||||
ViewTestData::createTestViews(static::class, ['taxonomy_test_views']);
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -421,7 +421,6 @@ class TrackerTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testTrackerAdminUnpublish() {
|
||||
\Drupal::service('module_installer')->install(['views']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$admin_user = $this->drupalCreateUser([
|
||||
'access content overview',
|
||||
'administer nodes',
|
||||
|
|
|
@ -77,7 +77,6 @@ class UserCancelTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testUserCancelChangePermission() {
|
||||
\Drupal::service('module_installer')->install(['user_form_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
|
||||
|
||||
// Create a regular user.
|
||||
|
@ -104,7 +103,6 @@ class UserCancelTest extends BrowserTestBase {
|
|||
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
|
||||
|
||||
\Drupal::service('module_installer')->install(['views']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Try to cancel uid 1's account with a different user.
|
||||
$admin_user = $this->drupalCreateUser(['administer users']);
|
||||
|
@ -542,7 +540,6 @@ class UserCancelTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testMassUserCancelByAdmin() {
|
||||
\Drupal::service('module_installer')->install(['views']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
|
||||
$user_storage = $this->container->get('entity_type.manager')->getStorage('user');
|
||||
// Enable account cancellation notification.
|
||||
|
|
|
@ -169,7 +169,6 @@ class UserRegistrationTest extends BrowserTestBase {
|
|||
*/
|
||||
public function testUuidFormState() {
|
||||
\Drupal::service('module_installer')->install(['image']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// Add a picture field in order to ensure that no form cache is written,
|
||||
// which breaks registration of more than 1 user every 6 hours.
|
||||
|
|
|
@ -22,7 +22,6 @@ class MigrateUserConfigsTest extends MigrateDrupal6TestBase {
|
|||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
$this->executeMigrations(['d6_user_mail', 'd6_user_settings']);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,6 @@ class UserAccountFormFieldsTest extends KernelTestBase {
|
|||
// Install default configuration; required for AccountFormController.
|
||||
$this->installConfig(['user']);
|
||||
|
||||
// Install the router table and then rebuild.
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$form = $this->buildAccountForm('default');
|
||||
|
||||
// Verify name and pass field order.
|
||||
|
|
|
@ -415,7 +415,6 @@ class DisplayTest extends ViewTestBase {
|
|||
*/
|
||||
public function testTranslationSetting() {
|
||||
\Drupal::service('module_installer')->install(['file']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
// By default there should be no language settings.
|
||||
$this->checkTranslationSetting();
|
||||
|
|
|
@ -80,9 +80,6 @@ class RowEntityRenderersTest extends ViewsKernelTestBase {
|
|||
$this->installSchema('node', ['node_access']);
|
||||
$this->installConfig(['node', 'language']);
|
||||
|
||||
// The entity.node.canonical route must exist when nodes are rendered.
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->langcodes = [\Drupal::languageManager()->getDefaultLanguage()->getId()];
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$langcode = 'l' . $i;
|
||||
|
|
|
@ -71,7 +71,6 @@ class FilterEqualityTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -126,7 +125,6 @@ class FilterEqualityTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
|
|
@ -75,7 +75,6 @@ class FilterNumericTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -200,7 +199,6 @@ class FilterNumericTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -230,7 +228,6 @@ class FilterNumericTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -375,7 +372,6 @@ class FilterNumericTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [];
|
||||
|
@ -392,7 +388,6 @@ class FilterNumericTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
|
|
@ -118,7 +118,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -175,7 +174,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -231,7 +229,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -341,7 +338,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -408,7 +404,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -461,7 +456,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -517,7 +511,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -570,7 +563,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -624,7 +616,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
|
||||
|
@ -678,7 +669,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -726,7 +716,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
@ -770,7 +759,6 @@ class FilterStringTest extends ViewsKernelTestBase {
|
|||
$view->setDisplay('page_1');
|
||||
$view->displayHandlers->get('page_1')->overrideOption('filters', $filters);
|
||||
$view->save();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->executeView($view);
|
||||
$resultset = [
|
||||
|
|
|
@ -46,7 +46,6 @@ class RowEntityTest extends ViewsKernelTestBase {
|
|||
|
||||
$this->installEntitySchema('taxonomy_term');
|
||||
$this->installConfig(['taxonomy']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,11 +22,6 @@ class TokenReplaceTest extends ViewsKernelTestBase {
|
|||
*/
|
||||
public static $testViews = ['test_tokens', 'test_invalid_tokens'];
|
||||
|
||||
protected function setUp($import_test_views = TRUE): void {
|
||||
parent::setUp();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests core token replacements generated from a view.
|
||||
*/
|
||||
|
|
|
@ -51,7 +51,6 @@ class AjaxFormCacheTest extends WebDriverTestBase {
|
|||
public function testBlockForms() {
|
||||
$this->container->get('module_installer')->install(['block', 'search']);
|
||||
$this->rebuildContainer();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
$this->drupalLogin($this->rootUser);
|
||||
|
||||
$this->drupalPlaceBlock('search_form_block', ['weight' => -5]);
|
||||
|
|
|
@ -18,15 +18,6 @@ class FormattableMarkupKernelTest extends KernelTestBase {
|
|||
*/
|
||||
protected static $modules = ['system'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets arguments for FormattableMarkup based on Url::fromUri() parameters.
|
||||
*
|
||||
|
|
|
@ -45,7 +45,6 @@ class AttachedAssetsTest extends KernelTestBase {
|
|||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->assetResolver = $this->container->get('asset.resolver');
|
||||
$this->renderer = $this->container->get('renderer');
|
||||
|
|
|
@ -39,7 +39,6 @@ class PathElementFormTest extends KernelTestBase implements FormInterface {
|
|||
parent::setUp();
|
||||
$this->installSchema('system', ['sequences', 'key_value_expire']);
|
||||
$this->installEntitySchema('user');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
/** @var \Drupal\user\RoleInterface $role */
|
||||
$role = Role::create([
|
||||
'id' => 'admin',
|
||||
|
|
|
@ -48,7 +48,6 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
|
|||
|
||||
$this->installSchema('system', ['key_value_expire']);
|
||||
$this->installEntitySchema('entity_test_string_id');
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
|
||||
$this->testUser = User::create([
|
||||
'name' => 'foobar1',
|
||||
|
|
|
@ -30,7 +30,6 @@ class FieldWidgetConstraintValidatorTest extends KernelTestBase {
|
|||
parent::setUp();
|
||||
|
||||
$this->installSchema('system', ['key_value']);
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
|
||||
$this->installEntitySchema('user');
|
||||
$this->installEntitySchema('entity_test_composite_constraint');
|
||||
|
|
|
@ -101,7 +101,6 @@ class StreamWrapperTest extends FileTestBase {
|
|||
// Test file_create_url()
|
||||
// TemporaryStream::getExternalUrl() uses Url::fromRoute(), which needs
|
||||
// route information to work.
|
||||
$this->container->get('router.builder')->rebuild();
|
||||
$this->assertStringContainsString('system/temporary?file=test.txt', file_create_url('temporary://test.txt'), 'Temporary external URL correctly built.');
|
||||
$this->assertStringContainsString(Settings::get('file_public_path') . '/test.txt', file_create_url('public://test.txt'), 'Public external URL correctly built.');
|
||||
$this->assertStringContainsString('system/files/test.txt', file_create_url('private://test.txt'), 'Private external URL correctly built.');
|
||||
|
|
|
@ -21,14 +21,6 @@ class StackKernelIntegrationTest extends KernelTestBase {
|
|||
*/
|
||||
protected static $modules = ['httpkernel_test', 'system'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests a request.
|
||||
*/
|
||||
|
|
|
@ -49,7 +49,6 @@ class MenuLinkTreeTest extends KernelTestBase {
|
|||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$this->installEntitySchema('user');
|
||||
$this->installEntitySchema('menu_link_content');
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ class RenderElementTypesTest extends KernelTestBase {
|
|||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->installConfig(['system']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -117,7 +117,6 @@ class ContentNegotiationRoutingTest extends KernelTestBase {
|
|||
*/
|
||||
public function testFullNegotiation() {
|
||||
$this->enableModules(['accept_header_routing_test']);
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
$tests = [
|
||||
// ['path', 'accept', 'content-type'],
|
||||
|
||||
|
|
|
@ -27,15 +27,6 @@ class ThemeRenderAndAutoescapeTest extends KernelTestBase {
|
|||
*/
|
||||
protected static $modules = ['system'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTestThemeRenderAndAutoescape
|
||||
*/
|
||||
|
|
|
@ -18,15 +18,6 @@ class RedirectOnExceptionTest extends KernelTestBase {
|
|||
*/
|
||||
protected static $modules = ['system', 'test_page_test'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
|
||||
\Drupal::service('router.builder')->rebuild();
|
||||
}
|
||||
|
||||
public function testRedirectOn404() {
|
||||
\Drupal::configFactory()->getEditable('system.site')
|
||||
->set('page.404', '/test-http-response-exception/' . Response::HTTP_PERMANENTLY_REDIRECT)
|
||||
|
|
Loading…
Reference in New Issue