Skip to content

Commit 2a61061

Browse files
committed
Remove support for PHPUnit < 11
1 parent 030837d commit 2a61061

File tree

3 files changed

+9
-48
lines changed

3 files changed

+9
-48
lines changed

modules/system/console/scaffold/test/phpunit.stub

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="../../../modules/system/tests/bootstrap/app.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
2+
<phpunit
3+
bootstrap="../../../modules/system/tests/bootstrap/app.php"
4+
colors="true"
115
>
126
<testsuites>
137
<testsuite name="Unit">

modules/system/tests/bootstrap/TestCase.php

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -85,55 +85,26 @@ public static function setProtectedProperty($object, $name, $value)
8585
}
8686

8787
/**
88-
* Stub for `assertFileNotExists` to allow compatibility with both PHPUnit 8 and 9.
89-
*
90-
* @param string $filename
91-
* @param string $message
92-
* @return void
88+
* Stub for `assertFileNotExists`
9389
*/
9490
public static function assertFileNotExists(string $filename, string $message = ''): void
9591
{
96-
if (method_exists(Assert::class, 'assertFileDoesNotExist')) {
97-
Assert::assertFileDoesNotExist($filename, $message);
98-
return;
99-
}
100-
101-
Assert::assertFileNotExists($filename, $message);
92+
Assert::assertFileDoesNotExist($filename, $message);
10293
}
10394

10495
/**
105-
* Stub for `assertRegExp` to allow compatibility with both PHPUnit 8 and 9.
106-
*
107-
* @param string $pattern
108-
* @param string $string
109-
* @param string $message
110-
* @return void
96+
* Stub for `assertRegExp`
11197
*/
11298
public static function assertRegExp(string $pattern, string $string, string $message = ''): void
11399
{
114-
if (method_exists(Assert::class, 'assertMatchesRegularExpression')) {
115-
Assert::assertMatchesRegularExpression($pattern, $string, $message);
116-
return;
117-
}
118-
119-
Assert::assertRegExp($pattern, $string, $message);
100+
Assert::assertMatchesRegularExpression($pattern, $string, $message);
120101
}
121102

122103
/**
123-
* Stub for `assertObjectHasAttribute` to allow compatibility with both PHPUnit 9 and 10.
124-
*
125-
* @param string $propertyName
126-
* @param object $object
127-
* @param string $message
128-
* @return void
104+
* Stub for `assertObjectHasAttribute`
129105
*/
130106
public static function assertObjectHasAttribute(string $propertyName, $object, string $message = ''): void
131107
{
132-
if (method_exists(Assert::class, 'assertObjectHasProperty')) {
133-
Assert::assertObjectHasProperty($propertyName, $object, $message);
134-
return;
135-
}
136-
137-
Assert::assertObjectHasAttribute($propertyName, $object, $message);
108+
Assert::assertObjectHasProperty($propertyName, $object, $message);
138109
}
139110
}

phpunit.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticProperties="false"
53
bootstrap="./modules/system/tests/bootstrap/app.php"
64
cacheDirectory=".phpunit.result.cache"
75
colors="true"
8-
processIsolation="false"
9-
stopOnFailure="false"
106
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
117
>
128
<testsuites>

0 commit comments

Comments
 (0)