public function testQueuedMessages() { $entity = m::mock('Guzzle\\Http\\Message\\EntityEnclosingRequest'); $entity->shouldReceive('send')->twice(); $http = m::mock('Guzzle\\Http\\Client'); $http->shouldReceive('post')->andReturn($entity)->twice(); $transport = new Guzzle('123', 'cog', 'vivalacrowe'); $transport->setHttp($http); $hippy = new Hippy($transport); $queue = new Queue(); $queue->add(new Message(true, 'red')); $queue->add(new Message(false, 'random')); $hippy->send($queue); }
/** * Add a html message to the queue. * * @param string $msg * @param bool $notify * @param string $background * @throws RuntimeException When Facade::init() has not been called. * @return void */ public static function addHtml($msg, $notify = false, $background = Message::BACKGROUND_YELLOW) { if (static::$client === null) { throw new RuntimeException('Must call init first'); } $message = new Message($notify, $background); $message->setHtml($msg); static::$queue->add($message); }