Codem\DamnFineUploader\_generated\UnitTesterActions::expectThrowable
[!] Method is generated. Documentation taken from corresponding module.
Handles and checks throwables (Exceptions/Errors) called inside the callback function. Either throwable class name or throwable instance should be provided. ```php <?php $I->expectThrowable(MyThrowable::class, function() { $this->doSomethingBad(); }); $I->expectThrowable(new MyException(), function() { $this->doSomethingBad(); }); ``` If you want to check message or throwable code, you can pass them with throwable instance: ```php <?php // will check that throwable MyError is thrown with "Don't do bad things" message $I->expectThrowable(new MyError("Don't do bad things"), function() { $this->doSomethingBad(); }); ```
Signature
public function expectThrowable(string
$throwable,
$callback )
Parameters
$throwable
— string- or \Throwable
$callback
—