diff --git a/core/modules/config/tests/src/Functional/ConfigImportBaseInstallProfileTest.php b/core/modules/config/tests/src/Functional/ConfigImportBaseInstallProfileTest.php index 583c3115..d1fb659c 100644 --- a/core/modules/config/tests/src/Functional/ConfigImportBaseInstallProfileTest.php +++ b/core/modules/config/tests/src/Functional/ConfigImportBaseInstallProfileTest.php @@ -25,7 +25,7 @@ class ConfigImportBaseInstallProfileTest extends BrowserTestBase { */ protected $webUser; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->webUser = $this->drupalCreateUser(['synchronize configuration']); @@ -48,17 +48,19 @@ public function testInstallParentProfileValidation() { unset($core['module']['testing']); $sync->write('core.extension', $core); - $this->drupalPostForm('admin/config/development/configuration', [], t('Import all')); - $this->assertText('The configuration cannot be imported because it failed validation for the following reasons:'); - $this->assertText('Unable to uninstall the Testing profile since it is a parent of another installed profile.'); + $this->drupalGet('admin/config/development/configuration'); + $this->submitForm([], 'Import all'); + $this->assertSession()->pageTextContains('The configuration cannot be imported because it failed validation for the following reasons:'); + $this->assertSession()->pageTextContains('Unable to uninstall the Testing profile since it is a parent of another installed profile.'); // Uninstall dependencies of parent profile. $core['module']['testing'] = 0; unset($core['module']['dynamic_page_cache']); $sync->write('core.extension', $core); $sync->deleteAll('dynamic_page_cache.'); - $this->drupalPostForm('admin/config/development/configuration', [], t('Import all')); - $this->assertText('The configuration was imported successfully.'); + $this->drupalGet('admin/config/development/configuration'); + $this->submitForm([], 'Import all'); + $this->assertSession()->pageTextContains('The configuration was imported successfully.'); $this->rebuildContainer(); $this->assertFalse(\Drupal::moduleHandler()->moduleExists('dynamic_page_cache'), 'The dynamic_page_cache module has been uninstalled.'); } @@ -78,17 +80,19 @@ public function testInstallSubProfileValidation() { unset($core['module']['testing_inherited']); $sync->write('core.extension', $core); - $this->drupalPostForm('admin/config/development/configuration', [], t('Import all')); - $this->assertText('The configuration cannot be imported because it failed validation for the following reasons:'); - $this->assertText('Unable to uninstall the Testing Inherited profile since it is the main install profile.'); + $this->drupalGet('admin/config/development/configuration'); + $this->submitForm([], 'Import all'); + $this->assertSession()->pageTextContains('The configuration cannot be imported because it failed validation for the following reasons:'); + $this->assertSession()->pageTextContains('Unable to uninstall the Testing Inherited profile since it is the main install profile.'); // Uninstall dependencies of main profile. $core['module']['testing_inherited'] = 0; unset($core['module']['syslog']); $sync->write('core.extension', $core); $sync->deleteAll('syslog.'); - $this->drupalPostForm('admin/config/development/configuration', [], t('Import all')); - $this->assertText('The configuration was imported successfully.'); + $this->drupalGet('admin/config/development/configuration'); + $this->submitForm([], 'Import all'); + $this->assertSession()->pageTextContains('The configuration was imported successfully.'); $this->rebuildContainer(); $this->assertFalse(\Drupal::moduleHandler()->moduleExists('syslog'), 'The syslog module has been uninstalled.'); } diff --git a/core/tests/Drupal/KernelTests/Core/Extension/ProfileExtensionListTest.php b/core/tests/Drupal/KernelTests/Core/Extension/ProfileExtensionListTest.php index 0c8faa21..1d767453 100644 --- a/core/tests/Drupal/KernelTests/Core/Extension/ProfileExtensionListTest.php +++ b/core/tests/Drupal/KernelTests/Core/Extension/ProfileExtensionListTest.php @@ -85,7 +85,7 @@ public function testGetAncestors() { */ public function testSelectDistribution() { $profile_list = new TestProfileExtensionList( - $this->container->get('app.root'), + $this->container->getParameter('app.root'), 'profile', $this->container->get('cache.default'), $this->container->get('info_parser'),