/** * Deletes a brokered message. * * Queues: * * @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780767 * * Topic Subscriptions: * @link http://msdn.microsoft.com/en-us/library/windowsazure/hh780768 * * @param BrokeredMessage $brokeredMessage The brokered message. * * @return none */ public function deleteMessage($brokeredMessage) { $httpCallContext = new HttpCallContext(); $httpCallContext->setMethod(Resources::HTTP_DELETE); $lockLocation = $brokeredMessage->getLockLocation(); $lockLocationArray = parse_url($lockLocation); $lockLocationPath = Resources::EMPTY_STRING; if (array_key_exists(Resources::PHP_URL_PATH, $lockLocationArray)) { $lockLocationPath = $lockLocationArray[Resources::PHP_URL_PATH]; $lockLocationPath = preg_replace('@^\\/@', Resources::EMPTY_STRING, $lockLocationPath); } if (empty($lockLocationPath)) { throw new \InvalidArgumentException(Resources::MISSING_LOCK_LOCATION_MSG); } $httpCallContext->setPath($lockLocationPath); $httpCallContext->addStatusCode(Resources::STATUS_OK); $this->sendContext($httpCallContext); }
/** * @covers WindowsAzure\ServiceBus\Models\BrokeredMessage::getLockLocation * @covers WindowsAzure\ServiceBus\Models\BrokeredMessage::setLockLocation */ public function testGetSetLockLocation() { // Setup $expected = 'testLockLocation'; $brokeredMessage = new BrokeredMessage(); // Test $brokeredMessage->setLockLocation($expected); $actual = $brokeredMessage->getLockLocation(); // Assert $this->assertEquals($expected, $actual); }