Skip to content
Snippets Groups Projects
Commit 0cc1a138 authored by catch's avatar catch
Browse files

Issue #3063182 by Spokje, Wim Leers, mondrake, Mile23: Remove PHPUnit 4.8 class aliasing BC layer

parent 9ed2caae
No related branches found
No related tags found
6 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards
<?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'));
}
}
...@@ -8,17 +8,6 @@ ...@@ -8,17 +8,6 @@
*/ */
use Drupal\Component\Assertion\Handle; 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. * Finds all valid extension directories recursively within a given directory.
...@@ -184,18 +173,3 @@ function drupal_phpunit_populate_class_loader() { ...@@ -184,18 +173,3 @@ function drupal_phpunit_populate_class_loader() {
// thrown if an assert fails, but this call does not turn runtime assertions on // thrown if an assert fails, but this call does not turn runtime assertions on
// if they weren't on already. // if they weren't on already.
Handle::register(); 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');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment