rcrowe\Hippy\Facade::go PHP Method

go() public static method

Send all messages in the queue.
public static go ( ) : void
return void
    public static function go()
    {
        if (static::$client === null) {
            throw new RuntimeException('Must call init first');
        }
        static::$client->send(static::$queue);
    }

Usage Example

Example #1
0
 public function testSendQueue()
 {
     $entity = m::mock('Guzzle\\Http\\Message\\EntityEnclosingRequest');
     $entity->shouldReceive('send')->times(3);
     $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')->andReturn($entity)->times(3);
     $transport = new Guzzle('123', 'egg', 'spoon');
     $transport->setHttp($http);
     Hippy::init(null, null, null, $transport);
     Hippy::add('test 1');
     Hippy::addHtml('test 2');
     Hippy::add('test 3');
     Hippy::go();
 }