public function testCheckListMessagesOptions() { $options = new ListMessagesOptions(); $this->assertNull($options->getTimeout(), 'Default ListMessagesOptions->getTimeout'); $this->assertNull($options->getNumberOfMessages(), 'Default ListMessagesOptions->getNumberOfMessages'); $this->assertNull($options->getVisibilityTimeoutInSeconds(), 'Default ListMessagesOptions->getVisibilityTimeoutInSeconds'); $options->setTimeout(self::INT_MAX_VALUE); $options->setNumberOfMessages(0); $options->setVisibilityTimeoutInSeconds(self::INT_MIN_VALUE); $this->assertEquals(self::INT_MAX_VALUE, $options->getTimeout(), 'Set ListMessagesOptions->getTimeout'); $this->assertEquals(0, $options->getNumberOfMessages(), 'Set ListMessagesOptions->getNumberOfMessages'); $this->assertEquals(self::INT_MIN_VALUE, $options->getVisibilityTimeoutInSeconds(), 'Set ListMessagesOptions->getVisibilityTimeoutInSeconds'); }
/** * @covers MicrosoftAzure\Storage\Queue\QueueRestProxy::clearMessages * @covers MicrosoftAzure\Storage\Queue\QueueRestProxy::createMessage * @covers MicrosoftAzure\Storage\Queue\QueueRestProxy::listMessages * @covers MicrosoftAzure\Storage\Queue\QueueRestProxy::peekMessages */ public function testListMessages() { $interestingTimes = array(null, -1, 0, QueueServiceFunctionalTestData::INTERESTING_TTL, 1000); $interestingNums = array(null, -1, 0, 2, 10, 1000); foreach ($interestingNums as $numberOfMessages) { foreach ($interestingTimes as $visibilityTimeoutInSeconds) { $options = new ListMessagesOptions(); $options->setNumberOfMessages($numberOfMessages); $options->setVisibilityTimeoutInSeconds($visibilityTimeoutInSeconds); $this->listMessagesWorker($options); } } foreach ($interestingTimes as $timeout) { $options = new ListMessagesOptions(); $options->setTimeout($timeout); $options->setNumberOfMessages(2); $options->setVisibilityTimeoutInSeconds(2); $this->listMessagesWorker($options); } }