function test_send_register_request_with_resource_url() { $this->mock->expects($this->atLeastOnce())->method("send")->withConsecutive(array("GNTP/1.0 REGISTER NONE"), array("Application-Name: unittest"), array("Application-Icon: http://localhost/resource1.jpg"), array("Notifications-Count: 1"), array(""), array("Notification-Name: name"), array("Notification-Icon: http://localhost/resource2.jpg"), array("Notification-Enabled: True"), array(""), array("")); $request = new RegisterRequest("unittest", array("icon_url" => "http://localhost/resource1.jpg")); $request->addNotification("name", array("icon_url" => "http://localhost/resource2.jpg")); $request->send($this->mock); }
protected function sendNotify($buffer, $type) { $growl = $this->createGrowl(); $register = new RegisterRequest("phpunit"); $register->addNotification("GREEN", array('icon_file' => __DIR__ . '/../../../resources/green.png')); $register->addNotification("RED", array('icon_file' => __DIR__ . '/../../../resources/red.png')); $register->addNotification("YELLOW", array('icon_file' => __DIR__ . '/../../../resources/yellow.png')); $notify = new NotificationRequest("phpunit", $type, "phpunit", array("text" => $buffer)); $growl->notifyOrRegister($notify, $register); }
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()); }