public function testDeleteException() { $exception = new \Braintree_Exception(); $cardToken = 1; $this->braintreeCreditCardMock->expects($this->once())->method('delete')->with($cardToken)->willThrowException($exception); $this->loggerMock->expects($this->once())->method('critical')->with($exception); $return = $this->model->deleteCard($cardToken); $this->assertEquals(false, $return); }