Skip to content

Commit 8c0384f

Browse files
authored
Update BaseTestCase.php
1 parent a31c978 commit 8c0384f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/BaseTestCase.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,19 @@
1212
abstract class BaseTestCase extends TestCase
1313
{
1414

15+
/**
16+
* @param callable $cb
17+
*
18+
* @return Throwable
19+
*/
20+
protected function runAndGetException(callable $cb): Throwable
21+
{
22+
try {
23+
$cb();
24+
} catch (Throwable $e) {
25+
return $e;
26+
}
27+
28+
return new RuntimeException('NO ERROR');
29+
}
1530
}

0 commit comments

Comments
 (0)