-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent unrelated error from being displayed if a scenario step has f…
…ailed (#6743) * Prevent unrelated error from being displayed if a scenario step has failed * Fix conditional asserts by checking test signature instead of object comparison due to cloning * Code style * Add test * Fix code style for test --------- Co-authored-by: Craig McMahon <craig.mcmahon@sturents.com>
- Loading branch information
1 parent
fcfa1d0
commit 066deb0
Showing
4 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
use Codeception\Test\Unit; | ||
use PHPUnit\Framework\AssertionFailedError; | ||
|
||
class ExpectedFailureTest extends Unit | ||
{ | ||
protected ScenarioGuy $tester; | ||
|
||
public function testExpectedFailure() | ||
{ | ||
static::fail(':-('); | ||
} | ||
|
||
public function testExpectedException() | ||
{ | ||
$this->expectException(AssertionFailedError::class); | ||
$this->tester->assertFalse(true); | ||
} | ||
} |