Skip to content

Commit 263fbf1

Browse files
committed
Add test for unmatched prerequisites
1 parent bbc8ead commit 263fbf1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/php/test/unittest/ExecutionTest.class.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use lang\IllegalStateException;
44
use test\execution\TestClass;
55
use test\outcome\{Succeeded, Failed, Skipped};
6+
use test\verify\Runtime;
67
use test\{Assert, Expect, Ignore, Test};
78

89
class ExecutionTest {
@@ -88,6 +89,17 @@ public function fixture() {
8889
}));
8990
}
9091

92+
#[Test]
93+
public function unmatched_prerequisites_skip_test() {
94+
Assert::equals(['fixture' => Skipped::class], $this->execute(new class() {
95+
96+
#[Test, Runtime(php: '<0.1.0')]
97+
public function fixture() {
98+
throw new IllegalStateException('Unreachable');
99+
}
100+
}));
101+
}
102+
91103
#[Test]
92104
public function incorrect_annotation_use_fails_test() {
93105
Assert::equals(['fixture' => Failed::class], $this->execute(new class() {

0 commit comments

Comments
 (0)