Esempio n. 1
0
 function test_simplenotify()
 {
     $gntp = new GNTP($this->io);
     $result = $gntp->sendNotify("gntp-test-simple", "notifytype1", "title", "text", array('icon_file' => __DIR__ . '/resources/a.png'));
     $this->assertEquals("-OK", $result);
     $result = $gntp->sendNotify("gntp-test-simple", "notifytype2", "title", "text\r\ntext\r\ntext", array('icon_file' => __DIR__ . '/resources/b.png'));
     $this->assertEquals("-OK", $result);
 }
Esempio n. 2
0
 function test_register_and_retry_notification_if_notification_is_unknown()
 {
     $this->mock->expects($this->any())->method("recv")->will($this->onConsecutiveCalls("GNTP/1.0 -ERROR NONE", "Error-Code: 402", false, "GNTP/1.0 -OK NONE", false, "GNTP/1.0 -OK NONE", false));
     $gntp = new GNTP($this->mock);
     $result = $gntp->sendNotify("unittest", "name", "title", "text");
     $this->assertEquals("-OK", $result);
 }