/**
  * @covers WindowsAzure\Table\Models\TableServiceOptions::getTimeout
  */
 public function testGetTimeout()
 {
     // Setup
     $options = new TableServiceOptions();
     $value = 10;
     $options->setTimeout($value);
     // Test
     $actualValue = $options->getTimeout();
     // Assert
     $this->assertEquals($value, $actualValue);
 }
Пример #2
0
 /**
  * Does batch of operations on the table service.
  * 
  * @param Models\BatchOperations     $batchOperations The operations to apply.
  * @param Models\TableServiceOptions $options         The optional parameters.
  * 
  * @return Models\BatchResult
  */
 public function batch($batchOperations, $options = null)
 {
     Validate::notNullOrEmpty($batchOperations, 'batchOperations');
     $method = Resources::HTTP_POST;
     $operations = $batchOperations->getOperations();
     $contexts = $this->_createOperationsContexts($operations);
     $mime = $this->_createBatchRequestBody($operations, $contexts);
     $body = $mime['body'];
     $headers = $mime['headers'];
     $postParams = array();
     $queryParams = array();
     $statusCode = Resources::STATUS_ACCEPTED;
     $path = '$batch';
     if (is_null($options)) {
         $options = new TableServiceOptions();
     }
     $this->addOptionalQueryParam($queryParams, Resources::QP_TIMEOUT, $options->getTimeout());
     $response = $this->send($method, $headers, $queryParams, $postParams, $path, $statusCode, $body);
     return BatchResult::create($response->getBody(), $operations, $contexts, $this->_atomSerializer, $this->_mimeSerializer);
 }