/** * Testing pulling the messages off the queue and deleting them. * This will go on until all messages are gone. */ public function testGetAndDeleteMessages() { self::$iio->disconnect(); self::$iio->services = array('mq'); self::$iio->connect(); //Get rid of all the messages on the test queue while (true) { $messageResult = self::$iio->mqGetMessage("test_queue"); //Returns null when we are out of messages if ($messageResult == null) { //End the test when the queue is empty break; } $this->assertEquals("The Message", $messageResult->body); $deleteResult = self::$iio->mqDeleteMessage("test_queue", $messageResult->id); $this->assertEquals('{"msg":"Deleted"}', $deleteResult); } }