diff --git a/composer.json b/composer.json index c3aa4f3509..3bfb0c7779 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup", "post-install-cmd": "Drupal\\Core\\Composer\\Composer::upgradePHPUnit", - "drupal-phpunit-upgrade": "@composer upgrade phpunit/phpunit --with-dependencies --no-progress", + "drupal-phpunit-upgrade": "@composer update phpunit/phpunit --with-dependencies --no-progress", "phpcs": "phpcs --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --", "phpcbf": "phpcbf --standard=core/phpcs.xml.dist --runtime-set installed_paths $($COMPOSER_BINARY config vendor-dir)/drupal/coder/coder_sniffer --" }, diff --git a/core/composer.json b/core/composer.json index c4bb384b92..797a9f9e37 100644 --- a/core/composer.json +++ b/core/composer.json @@ -44,7 +44,7 @@ "jcalderonzumba/gastonjs": "^1.0.2", "jcalderonzumba/mink-phantomjs-driver": "^0.3.1", "mikey179/vfsStream": "^1.2", - "phpunit/phpunit": "^4.8.35 || ^6.1", + "phpunit/phpunit": "^4.8.35 || ^6.0", "phpspec/prophecy": "^1.4", "symfony/css-selector": "~3.2.8", "symfony/phpunit-bridge": "^3.4.0@beta" diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php index 0c96b9b20f..9d3d386596 100644 --- a/core/lib/Drupal/Core/Composer/Composer.php +++ b/core/lib/Drupal/Core/Composer/Composer.php @@ -160,9 +160,9 @@ public static function upgradePHPUnit(Event $event) { return; } - // If the PHP version is 7.1 or above and PHPUnit is less than version 6 + // If the PHP version is 7.2 or above and PHPUnit is less than version 6 // call the drupal-phpunit-upgrade script to upgrade PHPUnit. - if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.1') >= 0 && version_compare($phpunit_package->getVersion(), '6.0') < 0) { + if (version_compare(PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, '7.2') >= 0 && version_compare($phpunit_package->getVersion(), '6.0') < 0) { $event->getComposer() ->getEventDispatcher() ->dispatchScript('drupal-phpunit-upgrade'); diff --git a/core/modules/tour/src/Tests/TourTestBase.php b/core/modules/tour/src/Tests/TourTestBase.php index f551c8151b..e139650706 100644 --- a/core/modules/tour/src/Tests/TourTestBase.php +++ b/core/modules/tour/src/Tests/TourTestBase.php @@ -14,17 +14,6 @@ */ abstract class TourTestBase extends WebTestBase { - /** - * {@inheritdoc} - */ - protected function setUp() { - // Support both PHPUnit 4 and 6. - if (!class_exists('\PHPUnit_Util_XML') && class_exists('\PHPUnit\Util\XML')) { - class_alias('\PHPUnit\Util\XML', '\PHPUnit_Util_XML'); - } - parent::setUp(); - } - /** * Assert function to determine if tips rendered to the page * have a corresponding page element. diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index e545318b87..407d87a34f 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -794,9 +794,9 @@ function simpletest_script_run_one_test($test_id, $test_class) { } else { // Prevent deprecations caused by vendor code calling deprecated code. - // This also prevents PHPUnit 6's mock code that triggers silenced + // This also prevents mock objects in PHPUnit 6 triggering silenced // deprecations from breaking the test suite. We should consider changing - // this to 'strict' once we are no longer use PHPUnit 4. + // this to 'strict' once PHPUnit 4 is no longer used. putenv('SYMFONY_DEPRECATIONS_HELPER=weak_vendors'); } if (is_subclass_of($test_class, TestCase::class)) { diff --git a/core/tests/Drupal/KernelTests/Core/Messenger/LegacyMessengerTest.php b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php similarity index 98% rename from core/tests/Drupal/KernelTests/Core/Messenger/LegacyMessengerTest.php rename to core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php index 13f10e9c2e..362069756e 100644 --- a/core/tests/Drupal/KernelTests/Core/Messenger/LegacyMessengerTest.php +++ b/core/tests/Drupal/KernelTests/Core/Messenger/MessengerTest.php @@ -11,7 +11,7 @@ * @group Messenger * @coversDefaultClass \Drupal\Core\Messenger\LegacyMessenger */ -class LegacyMessengerTest extends KernelTestBase { +class MessengerTest extends KernelTestBase { /** * Retrieves the Messenger service from LegacyMessenger.