X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Ftests%2Fbootstrap.php;h=82a1830547b3d8a9724f3f25787236d03169107d;hb=refs%2Fheads%2Fd864;hp=7eb6ecb70c1ee71da3cc6776afaecd373560d114;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/tests/bootstrap.php b/web/core/tests/bootstrap.php index 7eb6ecb70..82a183054 100644 --- a/web/core/tests/bootstrap.php +++ b/web/core/tests/bootstrap.php @@ -66,7 +66,7 @@ function drupal_phpunit_contrib_extension_directory_roots($root = NULL) { $paths[] = is_dir("$path/profiles") ? realpath("$path/profiles") : NULL; $paths[] = is_dir("$path/themes") ? realpath("$path/themes") : NULL; } - return array_filter($paths); + return array_filter($paths, 'file_exists'); } /** @@ -129,6 +129,7 @@ function drupal_phpunit_populate_class_loader() { // Start with classes in known locations. $loader->add('Drupal\\Tests', __DIR__); + $loader->add('Drupal\\TestSite', __DIR__); $loader->add('Drupal\\KernelTests', __DIR__); $loader->add('Drupal\\FunctionalTests', __DIR__); $loader->add('Drupal\\FunctionalJavascriptTests', __DIR__); @@ -159,7 +160,7 @@ else { $phpunit_version = Version::id(); } if (!Composer::upgradePHPUnitCheck($phpunit_version)) { - $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."; + $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."; echo "\033[31m" . $message . "\n\033[0m"; exit(1); } @@ -169,6 +170,10 @@ if (!Composer::upgradePHPUnitCheck($phpunit_version)) { // @see \Drupal\Core\DrupalKernel::bootEnvironment() setlocale(LC_ALL, 'C'); +// Set appropriate configuration for multi-byte strings. +mb_internal_encoding('utf-8'); +mb_language('uni'); + // Set the default timezone. While this doesn't cause any tests to fail, PHP // complains if 'date.timezone' is not set in php.ini. The Australia/Sydney // timezone is chosen so all tests are run using an edge case scenario (UTC+10 @@ -195,5 +200,5 @@ if (version_compare($phpunit_version, '6.1', '>=')) { class_alias('\PHPUnit\Framework\SkippedTestError', '\PHPUnit_Framework_SkippedTestError'); class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); class_alias('\PHPUnit\Util\Test', '\PHPUnit_Util_Test'); - class_alias('\PHPUnit\Util\XML', '\PHPUnit_Util_XML'); + class_alias('\PHPUnit\Util\Xml', '\PHPUnit_Util_XML'); }