Initial Drupal 11 with DDEV setup
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit10;
|
||||
|
||||
/**
|
||||
* Drupal's forward compatibility layer with multiple versions of PHPUnit.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
trait TestCompatibilityTrait {
|
||||
|
||||
/**
|
||||
* Gets @covers defined on the test class.
|
||||
*
|
||||
* @return string[]
|
||||
* An array of classes listed with the @covers annotation.
|
||||
*/
|
||||
public function getTestClassCovers(): array {
|
||||
$ret = [];
|
||||
foreach ($this->valueObjectForEvents()->metadata()->isCovers()->isClassLevel() as $metadata) {
|
||||
$ret[] = $metadata->target();
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit11;
|
||||
|
||||
/**
|
||||
* Drupal's forward compatibility layer with multiple versions of PHPUnit.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
trait TestCompatibilityTrait {
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\TestTools\PhpUnitCompatibility;
|
||||
|
||||
use PHPUnit\Runner\Version;
|
||||
|
||||
/**
|
||||
* Helper class to determine information about running PHPUnit version.
|
||||
*
|
||||
* This class contains static methods only and is not meant to be instantiated.
|
||||
*/
|
||||
final class RunnerVersion {
|
||||
|
||||
/**
|
||||
* This class should not be instantiated.
|
||||
*/
|
||||
private function __construct() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the major version of the PHPUnit runner being used.
|
||||
*
|
||||
* @return int
|
||||
* The major version of the PHPUnit runner being used.
|
||||
*/
|
||||
public static function getMajor() {
|
||||
return (int) explode('.', Version::id())[0];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user