コード例 #1
0
 /**
  * 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));
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 public function notify($id)
 {
     $invoice = $this->repository->get($id);
     return $this->invoiceNotifier->notify($invoice);
 }