Skip to content

Commit

Permalink
Add test for unmatched prerequisites
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Apr 15, 2023
1 parent bbc8ead commit 263fbf1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/php/test/unittest/ExecutionTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use lang\IllegalStateException;
use test\execution\TestClass;
use test\outcome\{Succeeded, Failed, Skipped};
use test\verify\Runtime;
use test\{Assert, Expect, Ignore, Test};

class ExecutionTest {
Expand Down Expand Up @@ -88,6 +89,17 @@ public function fixture() {
}));
}

#[Test]
public function unmatched_prerequisites_skip_test() {
Assert::equals(['fixture' => Skipped::class], $this->execute(new class() {

#[Test, Runtime(php: '<0.1.0')]
public function fixture() {
throw new IllegalStateException('Unreachable');
}
}));
}

#[Test]
public function incorrect_annotation_use_fails_test() {
Assert::equals(['fixture' => Failed::class], $this->execute(new class() {
Expand Down

0 comments on commit 263fbf1

Please sign in to comment.