/** * Populates the properties with the response from the list * subscriptions request. * * @param string $response The body of the response of the list * subscriptions request. * * @return none */ public function parseXml($response) { parent::parseXml($response); $listSubscriptionsResultXml = new \SimpleXMLElement($response); $this->_subscriptionInfos = array(); foreach ($listSubscriptionsResultXml->entry as $entry) { $subscriptionInfo = new SubscriptionInfo(); $subscriptionInfo->parseXml($entry->asXml()); $this->_subscriptionInfos[] = $subscriptionInfo; } }
/** * Gets a subscription. * * @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780741 * * @param string $topicPath The path of the topic. * @param string $subscriptionName The name of the subscription. * * @return SubscriptionInfo */ public function getSubscription($topicPath, $subscriptionName) { $httpCallContext = new HttpCallContext(); $httpCallContext->setMethod(Resources::HTTP_GET); $httpCallContext->addStatusCode(Resources::STATUS_OK); $subscriptionPath = sprintf(Resources::SUBSCRIPTION_PATH, $topicPath, $subscriptionName); $httpCallContext->setPath($subscriptionPath); $response = $this->sendContext($httpCallContext); $subscriptionInfo = new SubscriptionInfo(); $subscriptionInfo->parseXml($response->getBody()); return $subscriptionInfo; }
/** * @covers WindowsAzure\ServiceBus\ServiceBusRestProxy::createSubscription */ private function setupSubscriptions() { $s = new SubscriptionInfo($this->subscriptionName1); $s->setDeadLetteringOnFilterEvaluationExceptions(true); $s->setDeadLetteringOnMessageExpiration(true); $s->setEnableBatchedOperations(true); $s->setMaxDeliveryCount(10); $s->setRequiresSession(false); $this->restProxy->createSubscription($this->topicName, $s); $this->restProxy->createSubscription($this->topicName, new SubscriptionInfo($this->subscriptionName2)); $this->restProxy->createSubscription($this->topicName, new SubscriptionInfo($this->subscriptionName3)); $this->restProxy->createSubscription($this->topicName, new SubscriptionInfo($this->subscriptionName4)); }
/** * @covers WindowsAzure\ServiceBus\Models\SubscriptionInfo::getEnableBatchedOperations * @covers WindowsAzure\ServiceBus\Models\SubscriptionInfo::setEnableBatchedOperations */ public function testGetSetEnableBatchedOperations() { // Setup $expected = 'testEnableBatchedOperations'; $subscriptionInfo = new SubscriptionInfo(); // Test $subscriptionInfo->setEnableBatchedOperations($expected); $actual = $subscriptionInfo->getEnableBatchedOperations(); // Assert $this->assertEquals($expected, $actual); }