Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/Codeception/Module/Asserts.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace Codeception\Module;

use Codeception\Lib\Notification;
use Exception;
use Throwable;

/**
* Special module for using asserts in your tests.
Expand Down Expand Up @@ -35,7 +33,7 @@ class Asserts extends AbstractAsserts
* ```
*
* @deprecated Use expectThrowable() instead
* @param Exception|string $exception
* @param \Exception|string $exception
* @param callable $callback
*/
public function expectException($exception, $callback)
Expand Down Expand Up @@ -67,7 +65,7 @@ public function expectException($exception, $callback)
* });
* ```
*
* @param Throwable|string $throwable
* @param \Throwable|string $throwable
* @param callable $callback
*/
public function expectThrowable($throwable, $callback)
Expand All @@ -84,10 +82,10 @@ public function expectThrowable($throwable, $callback)

try {
$callback();
} catch (Exception $t) {
} catch (\Exception $t) {
$this->checkThrowable($t, $class, $msg, $code);
return;
} catch (Throwable $t) {
} catch (\Throwable $t) {
$this->checkThrowable($t, $class, $msg, $code);
return;
}
Expand All @@ -99,7 +97,7 @@ public function expectThrowable($throwable, $callback)
* Check if the given throwable matches the expected data,
* fail (throws an exception) if it does not.
*
* @param Throwable $throwable
* @param \Throwable $throwable
* @param string $expectedClass
* @param string $expectedMsg
* @param int $expectedCode
Expand Down