/** * @covers WindowsAzure\ServiceBus\ServiceBusRestProxy::createQueue * @covers WindowsAzure\ServiceBus\ServiceBusRestProxy::deleteQueue * @covers WindowsAzure\ServiceBus\ServiceBusRestProxy::getQueue * @covers WindowsAzure\ServiceBus\ServiceBusRestProxy::listQueues */ private function setupQueue() { $options = new ListQueuesOptions(); $options->setSkip(20); $options->setTop(2); $queues = $this->restProxy->listQueues($options)->getQueueInfos(); foreach ($queues as $queue) { self::write('Queue name is ' . $queue->getTitle()); } self::write('checking if queue already exists ' . $this->queueName); try { $this->restProxy->getQueue($this->queueName); self::write('Queue already exists deleting it'); $this->restProxy->deleteQueue($this->queueName); } catch (\Exception $e) { self::write('could not get an existing queue (' . $e->getCode() . '), proceeding...'); } $q = new QueueInfo($this->queueName); $q->setEnableBatchedOperations(true); $q->setMaxDeliveryCount(10); $q->setMaxSizeInMegabytes(1024); $q->setRequiresDuplicateDetection(true); self::write('Creating queue ' . $this->queueName); $this->restProxy->createQueue($q); $this->restProxy->getQueue($this->queueName); }
/** * @covers WindowsAzure\ServiceBus\Models\QueueInfo::getMaxSizeInMegabytes * @covers WindowsAzure\ServiceBus\Models\QueueInfo::setMaxSizeInMegabytes */ public function testGetSetMaxSizeInMegabytes() { // Setup $expected = 'testMaxSizeInMegabytes'; $queueInfo = new QueueInfo(); // Test $queueInfo->setMaxSizeInMegabytes($expected); $actual = $queueInfo->getMaxSizeInMegabytes(); // Assert $this->assertEquals($expected, $actual); }