comparison core/tests/bootstrap.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
127 /** @var \Composer\Autoload\ClassLoader $loader */ 127 /** @var \Composer\Autoload\ClassLoader $loader */
128 $loader = require __DIR__ . '/../../autoload.php'; 128 $loader = require __DIR__ . '/../../autoload.php';
129 129
130 // Start with classes in known locations. 130 // Start with classes in known locations.
131 $loader->add('Drupal\\Tests', __DIR__); 131 $loader->add('Drupal\\Tests', __DIR__);
132 $loader->add('Drupal\\TestSite', __DIR__);
132 $loader->add('Drupal\\KernelTests', __DIR__); 133 $loader->add('Drupal\\KernelTests', __DIR__);
133 $loader->add('Drupal\\FunctionalTests', __DIR__); 134 $loader->add('Drupal\\FunctionalTests', __DIR__);
134 $loader->add('Drupal\\FunctionalJavascriptTests', __DIR__); 135 $loader->add('Drupal\\FunctionalJavascriptTests', __DIR__);
135 136
136 if (!isset($GLOBALS['namespaces'])) { 137 if (!isset($GLOBALS['namespaces'])) {
157 } 158 }
158 else { 159 else {
159 $phpunit_version = Version::id(); 160 $phpunit_version = Version::id();
160 } 161 }
161 if (!Composer::upgradePHPUnitCheck($phpunit_version)) { 162 if (!Composer::upgradePHPUnitCheck($phpunit_version)) {
162 $message = "PHPUnit testing framework version 6 or greater is required when running on PHP 7.2 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this."; 163 $message = "PHPUnit testing framework version 6 or greater is required when running on PHP 7.0 or greater. Run the command 'composer run-script drupal-phpunit-upgrade' in order to fix this.";
163 echo "\033[31m" . $message . "\n\033[0m"; 164 echo "\033[31m" . $message . "\n\033[0m";
164 exit(1); 165 exit(1);
165 } 166 }
166 167
167 // Set sane locale settings, to ensure consistent string, dates, times and 168 // Set sane locale settings, to ensure consistent string, dates, times and
168 // numbers handling. 169 // numbers handling.
169 // @see \Drupal\Core\DrupalKernel::bootEnvironment() 170 // @see \Drupal\Core\DrupalKernel::bootEnvironment()
170 setlocale(LC_ALL, 'C'); 171 setlocale(LC_ALL, 'C');
172
173 // Set appropriate configuration for multi-byte strings.
174 mb_internal_encoding('utf-8');
175 mb_language('uni');
171 176
172 // Set the default timezone. While this doesn't cause any tests to fail, PHP 177 // Set the default timezone. While this doesn't cause any tests to fail, PHP
173 // complains if 'date.timezone' is not set in php.ini. The Australia/Sydney 178 // complains if 'date.timezone' is not set in php.ini. The Australia/Sydney
174 // timezone is chosen so all tests are run using an edge case scenario (UTC+10 179 // timezone is chosen so all tests are run using an edge case scenario (UTC+10
175 // and DST). This choice is made to prevent timezone related regressions and 180 // and DST). This choice is made to prevent timezone related regressions and
193 class_alias('\PHPUnit\Framework\Exception', '\PHPUnit_Framework_Exception'); 198 class_alias('\PHPUnit\Framework\Exception', '\PHPUnit_Framework_Exception');
194 class_alias('\PHPUnit\Framework\MockObject\Matcher\InvokedRecorder', '\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder'); 199 class_alias('\PHPUnit\Framework\MockObject\Matcher\InvokedRecorder', '\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder');
195 class_alias('\PHPUnit\Framework\SkippedTestError', '\PHPUnit_Framework_SkippedTestError'); 200 class_alias('\PHPUnit\Framework\SkippedTestError', '\PHPUnit_Framework_SkippedTestError');
196 class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); 201 class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
197 class_alias('\PHPUnit\Util\Test', '\PHPUnit_Util_Test'); 202 class_alias('\PHPUnit\Util\Test', '\PHPUnit_Util_Test');
198 class_alias('\PHPUnit\Util\XML', '\PHPUnit_Util_XML'); 203 class_alias('\PHPUnit\Util\Xml', '\PHPUnit_Util_XML');
199 } 204 }