コード例 #1
0
 function it_sends_room_notification(Client $client, Message $message)
 {
     $request = array("color" => "gray", "message" => "This is a test!!", 'notify' => false, 'message_format' => 'html');
     $message->toJson()->shouldBeCalled()->willReturn($request);
     $client->post("/v2/room/123456/notification", $request)->shouldBeCalled();
     $this->sendRoomNotification(123456, $message);
 }
コード例 #2
0
 /**
  * Send a room a notification
  * More info: https://www.hipchat.com/docs/apiv2/method/send_room_notification
  *
  * @param string $id The id or name of the room
  * @param Message $message The message to be sent
  *
  * @return void
  */
 public function sendRoomNotification($id, Message $message)
 {
     $this->client->post("/v2/room/{$id}/notification", $message->toJson());
 }