when(function($error, $result) use ($exception) { $this->assertNull($result); $this->assertSame($exception, $error); }); } }