Esempio n. 1
0
 public function testUseTransportToSendMessage()
 {
     $application = new Application("Test application");
     $type = new NotificationType("TEST1");
     $n1 = new Notification($type, "Title1", "Message1");
     $n2 = new Notification($type, "Title2", "Message2");
     $transport = $this->getMock('\\Growler\\Transport');
     $transport->expects($this->exactly(2))->method('send');
     $transport->expects($this->at(1))->method('send')->with($application, $n1);
     $transport->expects($this->at(2))->method('send')->with($application, $n2);
     $n = new Notifier($application, $transport);
     $n->registerNotification($type);
     $n->sendNotification($n1);
     $n->sendNotification($n2);
 }