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); }
function test_multiple() { $gntp = new GNTP($this->io); $register = new RegisterRequest("gntp-test-multiple"); $register->addNotification("notifytype1", array("icon_url" => "http://jigokuno.img.jugem.jp/20100730_1892085.gif")); $register->addNotification("notifytype2", array("icon_file" => __DIR__ . '/resources/c.png')); $notify = new NotificationRequest("gntp-test-multiple", "notifytype1", "title"); $result = $gntp->notifyOrRegister($notify, $register); $this->assertEquals("-OK", $result->getStatus()); }