diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 3a8afdf..95d7f47 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -478,6 +478,9 @@ function install_begin_request(&$install_state) { // supported by \Drupal\Core\Config\InstallStorage since loading a // non-existing file would throw an exception. $container->get('config.factory')->setOverrideState(FALSE); + + $container->register('size', 'Drupal\Core\Utility\Size') + ->addArgument(new Reference('string_translation')); } // Set the request in the kernel to the new created Request above diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index cf162fd..f01291c 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -1061,6 +1061,8 @@ private function prepareEnvironment() { ->addArgument(new Reference('language.default')); $this->container->register('string_translation', 'Drupal\Core\StringTranslation\TranslationManager') ->addArgument(new Reference('language_manager')); + $this->container->register('size', 'Drupal\Core\Utility\Size') + ->addArgument(new Reference('string_translation')); // Register info parser. $this->container->register('info_parser', 'Drupal\Core\Extension\InfoParser'); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 8143d71..7206874 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -1252,7 +1252,7 @@ protected function curlExec($curl_options, $redirect = FALSE) { '!method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'), '@url' => isset($original_url) ? $original_url : $url, '@status' => $status, - '!length' => $this->container->get('size')->format(strlen($this->drupalGetContent())) + '!length' => \Drupal::service('size')->format(strlen($this->drupalGetContent())) ); $message = String::format('!method @url returned @status (!length).', $message_vars); $this->assertTrue($this->drupalGetContent() !== FALSE, $message, 'Browser'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php index f94c419..1f69fac 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php @@ -7,12 +7,12 @@ namespace Drupal\system\Tests\Bootstrap; -use Drupal\simpletest\UnitTestBase; +use Drupal\simpletest\DrupalUnitTestBase; /** * Tests miscellaneous functions in bootstrap.inc. */ -class MiscUnitTest extends UnitTestBase { +class MiscUnitTest extends DrupalUnitTestBase { public static function getInfo() { return array(