/** * Test case when Mail Exception has been thrown */ public function testNotifyException() { $exception = new Exception('Email has not been sent'); $this->invoiceSenderMock->expects($this->once())->method('send')->with($this->equalTo($this->invoice))->will($this->throwException($exception)); $this->loggerMock->expects($this->once())->method('critical')->with($this->equalTo($exception)); $this->assertFalse($this->notifier->notify($this->invoice)); }
/** * @inheritdoc */ public function notify($id) { $invoice = $this->repository->get($id); return $this->invoiceNotifier->notify($invoice); }