Unverified Commit 53b4bf9c authored by alexpott's avatar alexpott

Issue #3106918 by longwave, mondrake, Gábor Hojtsy: Drop support of PHPUnit 6...

Issue #3106918 by longwave, mondrake, Gábor Hojtsy: Drop support of PHPUnit 6 in Drupal 9 because it will never get used anyway
parent baf8e01e
This diff is collapsed.
......@@ -16,7 +16,7 @@
"justinrainbow/json-schema": "^5.2",
"mikey179/vfsstream": "^1.6.8",
"phpspec/prophecy": "^1.7",
"phpunit/phpunit": "^6.5 || ^7",
"phpunit/phpunit": "^7",
"symfony/browser-kit": "^4.4",
"symfony/css-selector": "^4.4",
"symfony/debug": "^4.4",
......
......@@ -23,30 +23,29 @@
"instaclick/php-webdriver": "1.4.6",
"justinrainbow/json-schema": "5.2.8",
"mikey179/vfsstream": "v1.6.8",
"myclabs/deep-copy": "1.7.0",
"phar-io/manifest": "1.0.1",
"phar-io/version": "1.0.1",
"phpdocumentor/reflection-common": "1.0.1",
"phpdocumentor/reflection-docblock": "4.3.2",
"phpdocumentor/type-resolver": "0.5.1",
"phpspec/prophecy": "1.9.0",
"phpunit/php-code-coverage": "5.3.2",
"phpunit/php-file-iterator": "1.4.5",
"myclabs/deep-copy": "1.9.5",
"phar-io/manifest": "1.0.3",
"phar-io/version": "2.0.1",
"phpdocumentor/reflection-common": "2.0.0",
"phpdocumentor/reflection-docblock": "4.3.4",
"phpdocumentor/type-resolver": "1.0.1",
"phpspec/prophecy": "v1.10.2",
"phpunit/php-code-coverage": "6.1.4",
"phpunit/php-file-iterator": "2.0.2",
"phpunit/php-text-template": "1.2.1",
"phpunit/php-timer": "1.0.9",
"phpunit/php-token-stream": "2.0.2",
"phpunit/phpunit": "6.5.14",
"phpunit/phpunit-mock-objects": "5.0.10",
"phpunit/php-timer": "2.1.2",
"phpunit/php-token-stream": "3.1.1",
"phpunit/phpunit": "7.5.20",
"sebastian/code-unit-reverse-lookup": "1.0.1",
"sebastian/comparator": "2.1.3",
"sebastian/diff": "2.0.1",
"sebastian/environment": "3.1.0",
"sebastian/comparator": "3.0.2",
"sebastian/diff": "3.0.2",
"sebastian/environment": "4.2.3",
"sebastian/exporter": "3.1.2",
"sebastian/global-state": "2.0.0",
"sebastian/object-enumerator": "3.0.3",
"sebastian/object-reflector": "1.1.1",
"sebastian/recursion-context": "3.0.0",
"sebastian/resource-operations": "1.0.0",
"sebastian/resource-operations": "2.0.1",
"sebastian/version": "2.0.1",
"seld/jsonlint": "1.7.1",
"seld/phar-utils": "1.0.1",
......@@ -59,6 +58,6 @@
"symfony/lock": "v4.4.2",
"symfony/phpunit-bridge": "v4.4.2",
"theseer/tokenizer": "1.1.3",
"webmozart/assert": "1.5.0"
"webmozart/assert": "1.6.0"
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit6;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
/**
* Listens to PHPUnit test runs.
*
* @internal
*/
class AfterSymfonyListener implements TestListener {
use TestListenerDefaultImplementation;
/**
* {@inheritdoc}
*/
public function endTest(Test $test, $time) {
restore_error_handler();
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit6;
use Drupal\Tests\Listeners\DeprecationListenerTrait;
use Drupal\Tests\Listeners\DrupalComponentTestListenerTrait;
use Drupal\Tests\Listeners\DrupalStandardsListenerTrait;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use PHPUnit\Framework\Test;
/**
* Listens to PHPUnit test runs.
*
* @internal
*/
class DrupalListener implements TestListener {
use TestListenerDefaultImplementation;
use DeprecationListenerTrait;
use DrupalComponentTestListenerTrait;
use DrupalStandardsListenerTrait;
/**
* {@inheritdoc}
*/
public function startTest(Test $test) {
$this->deprecationStartTest($test);
}
/**
* {@inheritdoc}
*/
public function endTest(Test $test, $time) {
$this->deprecationEndTest($test, $time);
$this->componentEndTest($test, $time);
$this->standardsEndTest($test, $time);
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit6;
use Drupal\Tests\Listeners\HtmlOutputPrinterTrait;
use PHPUnit\Framework\TestResult;
use PHPUnit\TextUI\ResultPrinter;
/**
* Defines a class for providing html output results for functional tests.
*
* @internal
*/
class HtmlOutputPrinter extends ResultPrinter {
use HtmlOutputPrinterTrait;
/**
* {@inheritdoc}
*/
public function printResult(TestResult $result) {
parent::printResult($result);
$this->printHtmlOutput();
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit6;
/**
* Defines a class for providing html output links in the Simpletest UI.
*/
class SimpletestUiPrinter extends HtmlOutputPrinter {
/**
* {@inheritdoc}
*/
public function write($buffer) {
$this->simpletestUiWrite($buffer);
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit6;
/**
* Makes Drupal's test API forward compatible with multiple versions of PHPUnit.
*/
trait StubTestSuiteBaseTrait {
/**
* {@inheritdoc}
*/
public function addTestFiles($filenames) {
// We stub addTestFiles() because the parent implementation can't deal with
// vfsStream-based filesystems due to an error in
// stream_resolve_include_path(). See
// https://github.com/mikey179/vfsStream/issues/5 Here we just store the
// test file being added in $this->testFiles.
$this->testFiles = array_merge($this->testFiles, $filenames);
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit7;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
/**
* Listens to PHPUnit test runs.
*
* @internal
*/
class AfterSymfonyListener implements TestListener {
use TestListenerDefaultImplementation;
/**
* {@inheritdoc}
*/
public function endTest(Test $test, float $time): void {
restore_error_handler();
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit7;
use Drupal\Tests\Listeners\DeprecationListenerTrait;
use Drupal\Tests\Listeners\DrupalComponentTestListenerTrait;
use Drupal\Tests\Listeners\DrupalStandardsListenerTrait;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use PHPUnit\Framework\Test;
/**
* Listens to PHPUnit test runs.
*
* @internal
*/
class DrupalListener implements TestListener {
use TestListenerDefaultImplementation;
use DeprecationListenerTrait;
use DrupalComponentTestListenerTrait;
use DrupalStandardsListenerTrait;
/**
* {@inheritdoc}
*/
public function startTest(Test $test): void {
$this->deprecationStartTest($test);
}
/**
* {@inheritdoc}
*/
public function endTest(Test $test, float $time): void {
$this->deprecationEndTest($test, $time);
$this->componentEndTest($test, $time);
$this->standardsEndTest($test, $time);
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit7;
use Drupal\Tests\Listeners\HtmlOutputPrinterTrait;
use PHPUnit\Framework\TestResult;
use PHPUnit\TextUI\ResultPrinter;
/**
* Defines a class for providing html output results for functional tests.
*
* @internal
*/
class HtmlOutputPrinter extends ResultPrinter {
use HtmlOutputPrinterTrait;
/**
* {@inheritdoc}
*/
public function printResult(TestResult $result): void {
parent::printResult($result);
$this->printHtmlOutput();
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit7;
/**
* Defines a class for providing html output links in the Simpletest UI.
*/
class SimpletestUiPrinter extends HtmlOutputPrinter {
/**
* {@inheritdoc}
*/
public function write(string $buffer): void {
$this->simpletestUiWrite($buffer);
}
}
<?php
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit7;
/**
* Makes Drupal's test API forward compatible with multiple versions of PHPUnit.
*/
trait StubTestSuiteBaseTrait {
/**
* {@inheritdoc}
*/
public function addTestFiles($filenames): void {
// We stub addTestFiles() because the parent implementation can't deal with
// vfsStream-based filesystems due to an error in
// stream_resolve_include_path(). See
// https://github.com/mikey179/vfsStream/issues/5 Here we just store the
// test file being added in $this->testFiles.
$this->testFiles = array_merge($this->testFiles, $filenames);
}
}
......@@ -2,7 +2,6 @@
namespace Drupal\Tests\Core\Test;
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
use Drupal\Tests\TestSuites\TestSuiteBase;
use org\bovigo\vfs\vfsStream;
use PHPUnit\Framework\TestCase;
......@@ -11,13 +10,6 @@
// manually.
require_once __DIR__ . '/../../../../TestSuites/TestSuiteBase.php';
// In order to manage different method signatures between PHPUnit versions, we
// dynamically load a compatibility trait dependent on the PHPUnit runner
// version.
if (!trait_exists(PhpunitVersionDependentStubTestSuiteBaseTrait::class, FALSE)) {
class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\StubTestSuiteBaseTrait", PhpunitVersionDependentStubTestSuiteBaseTrait::class);
}
/**
* @coversDefaultClass \Drupal\Tests\TestSuites\TestSuiteBase
*
......@@ -128,8 +120,6 @@ public function testLocalTimeZone() {
*/
class StubTestSuiteBase extends TestSuiteBase {
use PhpunitVersionDependentStubTestSuiteBaseTrait;
/**
* Test files discovered by addTestsBySuiteNamespace().
*
......@@ -149,4 +139,16 @@ protected function findExtensionDirectories($root) {
return [];
}
/**
* {@inheritdoc}
*/
public function addTestFiles($filenames): void {
// We stub addTestFiles() because the parent implementation can't deal with
// vfsStream-based filesystems due to an error in
// stream_resolve_include_path(). See
// https://github.com/mikey179/vfsStream/issues/5 Here we just store the
// test file being added in $this->testFiles.
$this->testFiles = array_merge($this->testFiles, $filenames);
}
}
<?php
namespace Drupal\Tests\Listeners;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
/**
* @file
* Listens to PHPUnit test runs.
*
* In order to manage different method signatures between PHPUnit versions, we
* dynamically load a class dependent on the PHPUnit runner version.
* @internal
*/
class AfterSymfonyListener implements TestListener {
use TestListenerDefaultImplementation;
namespace Drupal\Tests\Listeners;
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
/**
* {@inheritdoc}
*/
public function endTest(Test $test, float $time): void {
restore_error_handler();
}
class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\AfterSymfonyListener", AfterSymfonyListener::class);
}
<?php
namespace Drupal\Tests\Listeners;
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestListenerDefaultImplementation;
use PHPUnit\Framework\Test;
/**
* @file
* Listens to PHPUnit test runs.
*
* In order to manage different method signatures between PHPUnit versions, we
* dynamically load a class dependent on the PHPUnit runner version.
* @internal
*/
class DrupalListener implements TestListener {
namespace Drupal\Tests\Listeners;
use TestListenerDefaultImplementation;
use DeprecationListenerTrait;
use DrupalComponentTestListenerTrait;
use DrupalStandardsListenerTrait;
/**
* {@inheritdoc}
*/
public function startTest(Test $test): void {
$this->deprecationStartTest($test);
}
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
/**
* {@inheritdoc}
*/
public function endTest(Test $test, float $time): void {
$this->deprecationEndTest($test, $time);
$this->componentEndTest($test, $time);
$this->standardsEndTest($test, $time);
}
class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\DrupalListener", DrupalListener::class);
}
<?php
namespace Drupal\Tests\Listeners;
use PHPUnit\Framework\TestResult;
use PHPUnit\TextUI\ResultPrinter;
/**
* @file
* Defines a class for providing html output results for functional tests.
*
* In order to manage different method signatures between PHPUnit versions, we
* dynamically load a class dependent on the PHPUnit runner version.
* @internal
*/
class HtmlOutputPrinter extends ResultPrinter {
namespace Drupal\Tests\Listeners;
use HtmlOutputPrinterTrait;
/**
* {@inheritdoc}
*/
public function printResult(TestResult $result): void {
parent::printResult($result);
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
$this->printHtmlOutput();
}
class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\HtmlOutputPrinter", HtmlOutputPrinter::class);
}
<?php
namespace Drupal\Tests\Listeners;
/**
* @file
* Defines a class for providing html output links in the Simpletest UI.
*
* In order to manage different method signatures between PHPUnit versions, we
* dynamically load a class dependent on the PHPUnit runner version.
*/
class SimpletestUiPrinter extends HtmlOutputPrinter {
namespace Drupal\Tests\Listeners;
use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion;
/**
* {@inheritdoc}
*/
public function write(string $buffer): void {
$this->simpletestUiWrite($buffer);
}
class_alias("Drupal\TestTools\PhpUnitCompatibility\PhpUnit" . RunnerVersion::getMajor() . "\SimpletestUiPrinter", SimpletestUiPrinter::class);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment