public function testhandleCreateCase() { //unset and reconnect Db to resolve mysqli fetch exeception global $db; unset($db->database); $db->checkConnection(); $inboundEmail = new InboundEmail(); $email = new Email(); $email->name = 'test'; //execute the method and test if it works and does not throws an exception. try { $inboundEmail->handleCreateCase($email, 1); $this->assertTrue(true); } catch (Exception $e) { $this->fail(); } }