예제 #1
0
 public function testMissingRequestReturnNull()
 {
     $this->socket->expects($this->once())->method('send')->with(TaskManager::MESSAGE_PROCESS_UPDATE);
     $this->socket->expects($this->once())->method('recv')->will($this->returnValue(json_encode(['request' => TaskManager::MESSAGE_PROCESS_UPDATE])));
     $this->setExpectedException(RuntimeException::class, 'Invalid task manager response : missing fields.');
     $this->sut->notify(Notifier::MESSAGE_CREATE);
 }
예제 #2
0
 private function notify($message)
 {
     try {
         $this->notifier->notify($message);
     } catch (RuntimeException $e) {
     }
 }
예제 #3
0
 public function testMissingRequestReturnNull()
 {
     $socket = $this->createSocketMock();
     $socket->expects($this->once())->method('send')->with(TaskManager::MESSAGE_PROCESS_UPDATE);
     $socket->expects($this->once())->method('recv')->will($this->returnValue(json_encode(['request' => TaskManager::MESSAGE_PROCESS_UPDATE])));
     $notifier = new Notifier($socket, $this->getMock('Psr\\Log\\LoggerInterface'));
     $this->setExpectedException('Alchemy\\Phrasea\\Exception\\RuntimeException', 'Invalid task manager response : missing fields.');
     $notifier->notify(Notifier::MESSAGE_CREATE);
 }