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