/** * @expectedException PHPUnit_Framework_AssertionFailedError */ public function testExceptionFails() { $module = new \Codeception\Module\Asserts(make_container()); $module->expectException(new Exception('here', 200), function () { throw new Exception('here', 2); }); }