From 0cc1a138e8779fec34eed019b6f1b7fd6ad8c4aa Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Tue, 21 Jan 2020 11:12:21 +0000 Subject: [PATCH] Issue #3063182 by Spokje, Wim Leers, mondrake, Mile23: Remove PHPUnit 4.8 class aliasing BC layer --- .../Tests/Phpunit4CompatibilityTest.php | 89 ------------------- core/tests/bootstrap.php | 26 ------ 2 files changed, 115 deletions(-) delete mode 100644 core/tests/Drupal/Tests/Phpunit4CompatibilityTest.php diff --git a/core/tests/Drupal/Tests/Phpunit4CompatibilityTest.php b/core/tests/Drupal/Tests/Phpunit4CompatibilityTest.php deleted file mode 100644 index 639e6fa35f3e..000000000000 --- a/core/tests/Drupal/Tests/Phpunit4CompatibilityTest.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -namespace Drupal\Tests; - -/** - * Tests existence of the PHPUnit4 backward compatibility classes. - * - * @group Tests - */ -class Phpunit4CompatibilityTest extends UnitTestCase { - - /** - * Tests existence of \PHPUnit_Framework_AssertionFailedError. - */ - public function testFrameworkAssertionFailedError() { - $this->assertTrue(class_exists('\PHPUnit_Framework_AssertionFailedError')); - } - - /** - * Tests existence of \PHPUnit_Framework_Constraint_Count. - */ - public function testFrameworkConstraintCount() { - $this->assertTrue(class_exists('\PHPUnit_Framework_Constraint_Count')); - } - - /** - * Tests existence of \PHPUnit_Framework_Error. - */ - public function testFrameworkError() { - $this->assertTrue(class_exists('\PHPUnit_Framework_Error')); - } - - /** - * Tests existence of \PHPUnit_Framework_Error_Warning. - */ - public function FrameworkErrorWarning() { - $this->assertTrue(class_exists('\PHPUnit_Framework_Error_Warning')); - } - - /** - * Tests existence of \PHPUnit_Framework_Exception. - */ - public function testFrameworkException() { - $this->assertTrue(class_exists('\PHPUnit_Framework_Exception')); - } - - /** - * Tests existence of \PHPUnit_Framework_ExpectationFailedException. - */ - public function testFrameworkExpectationFailedException() { - $this->assertTrue(class_exists('\PHPUnit_Framework_ExpectationFailedException')); - } - - /** - * Tests existence of \PHPUnit_Framework_MockObject_Matcher_InvokedRecorder. - */ - public function testFrameworkMockObjectMatcherInvokedRecorder() { - $this->assertTrue(class_exists('\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder')); - } - - /** - * Tests existence of \PHPUnit_Framework_SkippedTestError. - */ - public function testFrameworkSkippedTestError() { - $this->assertTrue(class_exists('\PHPUnit_Framework_SkippedTestError')); - } - - /** - * Tests existence of \PHPUnit_Framework_TestCase. - */ - public function testFrameworkTestCase() { - $this->assertTrue(class_exists('\PHPUnit_Framework_TestCase')); - } - - /** - * Tests existence of \PHPUnit_Util_Test. - */ - public function testUtilTest() { - $this->assertTrue(class_exists('\PHPUnit_Util_Test')); - } - - /** - * Tests existence of \PHPUnit_Util_XML. - */ - public function testUtilXml() { - $this->assertTrue(class_exists('\PHPUnit_Util_XML')); - } - -} diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php index 467e6af6e603..4146f999a75e 100644 --- a/core/tests/bootstrap.php +++ b/core/tests/bootstrap.php @@ -8,17 +8,6 @@ */ use Drupal\Component\Assertion\Handle; -use PHPUnit\Framework\AssertionFailedError; -use PHPUnit\Framework\Constraint\Count; -use PHPUnit\Framework\Error\Error; -use PHPUnit\Framework\Error\Warning; -use PHPUnit\Framework\ExpectationFailedException; -use PHPUnit\Framework\Exception; -use PHPUnit\Framework\MockObject\Matcher\InvokedRecorder; -use PHPUnit\Framework\SkippedTestError; -use PHPUnit\Framework\TestCase; -use PHPUnit\Util\Test; -use PHPUnit\Util\Xml; /** * Finds all valid extension directories recursively within a given directory. @@ -184,18 +173,3 @@ function drupal_phpunit_populate_class_loader() { // thrown if an assert fails, but this call does not turn runtime assertions on // if they weren't on already. Handle::register(); - -// PHPUnit 4 to PHPUnit 6 bridge. Tests written for PHPUnit 4 need to work on -// PHPUnit 6 with a minimum of fuss. -// @todo provided for BC; remove in Drupal 9. -class_alias(AssertionFailedError::class, '\PHPUnit_Framework_AssertionFailedError'); -class_alias(Count::class, '\PHPUnit_Framework_Constraint_Count'); -class_alias(Error::class, '\PHPUnit_Framework_Error'); -class_alias(Warning::class, '\PHPUnit_Framework_Error_Warning'); -class_alias(ExpectationFailedException::class, '\PHPUnit_Framework_ExpectationFailedException'); -class_alias(Exception::class, '\PHPUnit_Framework_Exception'); -class_alias(InvokedRecorder::class, '\PHPUnit_Framework_MockObject_Matcher_InvokedRecorder'); -class_alias(SkippedTestError::class, '\PHPUnit_Framework_SkippedTestError'); -class_alias(TestCase::class, '\PHPUnit_Framework_TestCase'); -class_alias(Test::class, '\PHPUnit_Util_Test'); -class_alias(Xml::class, '\PHPUnit_Util_XML'); -- GitLab