diff --git a/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php index 899c7d8..d4b9992 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/InstallerTestBase.php @@ -7,7 +7,11 @@ namespace Drupal\simpletest; +use Drupal\Core\Language\Language; use Drupal\Core\Session\UserSession; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\HttpFoundation\Request; /** * Base class for testing the interactive installer. @@ -91,6 +95,25 @@ protected function setUp() { // @see WebTestBase::translatePostValues() $this->parameters = $this->installParameters(); + // Set up a minimal container (required by WebTestBase). + // @see install_begin_request() + $request = Request::create($GLOBALS['base_url'] . '/core/install.php'); + $this->container = new ContainerBuilder(); + $this->container + ->set('request', $request); + $this->container + ->setParameter('language.default_values', Language::$defaultValues); + $this->container + ->register('language.default', 'Drupal\Core\Language\LanguageDefault') + ->addArgument('%language.default_values%'); + $this->container + ->register('language_manager', 'Drupal\Core\Language\LanguageManager') + ->addArgument(new Reference('language.default')); + $this->container + ->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager') + ->addArgument(new Reference('language_manager')); + \Drupal::setContainer($this->container); + $this->drupalGet($GLOBALS['base_url'] . '/core/install.php'); // Select language. diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php index ec9bbb4..3d076ce 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/HtmlIdentifierUnitTest.php @@ -7,13 +7,12 @@ namespace Drupal\system\Tests\Common; -use Drupal\simpletest\UnitTestBase; -use Symfony\Component\HttpFoundation\Request; +use Drupal\simpletest\DrupalUnitTestBase; /** * Tests cleaning HTML identifiers. */ -class HtmlIdentifierUnitTest extends UnitTestBase { +class HtmlIdentifierUnitTest extends DrupalUnitTestBase { public static function getInfo() { return array( 'name' => 'HTML identifiers', @@ -23,18 +22,6 @@ public static function getInfo() { } /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(); - - $container = \Drupal::getContainer(); - $request = new Request(); - $container->set('request', $request); - \Drupal::setContainer($container); - } - - /** * Tests that drupal_clean_css_identifier() cleans the identifier properly. */ function testDrupalCleanCSSIdentifier() { diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php index 59eca4a..436b8a1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/TableSortExtenderUnitTest.php @@ -7,13 +7,13 @@ namespace Drupal\system\Tests\Common; -use Drupal\simpletest\UnitTestBase; +use Drupal\simpletest\DrupalUnitTestBase; use Symfony\Component\HttpFoundation\Request; /** * Tests unicode handling features implemented in unicode.inc. */ -class TableSortExtenderUnitTest extends UnitTestBase { +class TableSortExtenderUnitTest extends DrupalUnitTestBase { public static function getInfo() { return array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php index 20a574a..ea02491 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/Discovery/DiscoveryTestBase.php @@ -7,12 +7,12 @@ namespace Drupal\system\Tests\Plugin\Discovery; -use Drupal\simpletest\UnitTestBase; +use Drupal\simpletest\DrupalUnitTestBase; /** * Tests that plugins are correctly discovered. */ -class DiscoveryTestBase extends UnitTestBase { +class DiscoveryTestBase extends DrupalUnitTestBase { /** * The discovery component to test.