html() public static method

Send a html message.
public static html ( string $msg, boolean $notify = false, string $background = Message::BACKGROUND_YELLOW ) : void
$msg string
$notify boolean
$background string
return void
Example #1
0
 public function testSendHtmlMessage()
 {
     $entity = m::mock('Guzzle\\Http\\Message\\EntityEnclosingRequest');
     $entity->shouldReceive('send')->once();
     $data = array('room_id' => 'egg', 'from' => 'spoon', 'message' => 'hello world', 'message_format' => 'html', 'notify' => false, 'color' => 'yellow', 'format' => 'json');
     $http = m::mock('Guzzle\\Http\\Client');
     $http->shouldReceive('post')->with('rooms/message?format=json&auth_token=123', array('Content-type' => 'application/x-www-form-urlencoded'), http_build_query($data))->andReturn($entity)->once();
     $transport = new Guzzle('123', 'egg', 'spoon');
     $transport->setHttp($http);
     Hippy::init(null, null, null, $transport);
     Hippy::html('hello world');
 }