Skip to content

Commit 39e9acd

Browse files
committed
Add TestException
1 parent fdb9010 commit 39e9acd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/TestException.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace Amp\PHPUnit;
4+
5+
/**
6+
* Generic exception to be used in cases where an exception should be thrown and caught, but if the exception is not
7+
* thrown, the test should fail using $this->fail(...).
8+
*
9+
* try {
10+
* functionCallThatShouldThrow();
11+
* $this->fail("Expected functionCallThatShouldThrow() to throw.");
12+
* } catch (TestException $e) {
13+
* $this->assertSame($expectedExceptionInstance, $e);
14+
* }
15+
*/
16+
class TestException extends \Exception {
17+
}

0 commit comments

Comments
 (0)