Skip to content

Commit 21eb672

Browse files
committed
Fix testMarkTestSkipped compatibility
1 parent a499352 commit 21eb672

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: [8.1, 8.2, 8.3, 8.4]
11+
php: [8.2, 8.3, 8.4]
1212

1313
steps:
1414
- name: Checkout code

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"homepage": "https://codeception.com/",
2424
"require": {
25-
"php": "^8.1",
25+
"php": "^8.2",
2626
"codeception/codeception": "*@dev",
2727
"codeception/lib-asserts": "^2.2"
2828
},

tests/unit/Codeception/Module/AssertsTest.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
use PHPUnit\Framework\AssertionFailedError;
1313
use PHPUnit\Framework\Constraint\IsEqual;
1414
use PHPUnit\Framework\IncompleteTestError;
15+
use PHPUnit\Framework\SkippedTestError;
1516
use PHPUnit\Framework\SkippedWithMessageException;
17+
use PHPUnit\Runner\Version as PHPUnitVersion;
1618
use RuntimeException;
1719
use stdClass;
1820

@@ -280,8 +282,12 @@ public function testMarkTestIncomplete()
280282

281283
public function testMarkTestSkipped()
282284
{
283-
$this->expectException(SkippedWithMessageException::class);
284285
$this->expectExceptionMessage('foobar');
286+
if (PHPUnitVersion::series() < 10) {
287+
$this->expectException(SkippedTestError::class);
288+
} else {
289+
$this->expectException(SkippedWithMessageException::class);
290+
}
285291

286292
$this->module->markTestSkipped('foobar');
287293
}

0 commit comments

Comments
 (0)