[Dep] Add PHPUnit\Framework\TestCase stub on target-repository bootstrap.php (#1924)

This commit is contained in:
Abdul Malik Ikhsan 2022-03-13 00:26:48 +07:00 committed by GitHub
parent a7bdabc86a
commit 9d74e20acb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,10 @@
declare(strict_types = 1);
// inspired by https://github.com/phpstan/phpstan/blob/master/bootstrap.php
spl_autoload_register(function (string $class): void {
namespace
{
// inspired by https://github.com/phpstan/phpstan/blob/master/bootstrap.php
spl_autoload_register(function (string $class): void {
static $composerAutoloader;
// already loaded in bin/rector.php
@ -35,9 +36,9 @@ spl_autoload_register(function (string $class): void {
return;
}
}
});
});
if (! interface_exists('UnitEnum')) {
if (! interface_exists('UnitEnum')) {
/**
* @since 8.1
*/
@ -48,9 +49,9 @@ if (! interface_exists('UnitEnum')) {
*/
public static function cases(): array;
}
}
}
if (! interface_exists('BackedEnum')) {
if (! interface_exists('BackedEnum')) {
/**
* @since 8.1
*/
@ -67,4 +68,15 @@ if (! interface_exists('BackedEnum')) {
*/
public static function tryFrom($value);
}
}
}
// @see https://github.com/rectorphp/rector/issues/6531
namespace PHPUnit\Framework
{
if (! class_exists('PHPUnit\Framework\TestCase')) {
abstract class TestCase
{
}
}
}