コード例 #1
0
 public static function tearDownAfterClass()
 {
     if (self::$isOneTimeSetup) {
         $integrationTestBase = new IntegrationTestBase();
         $integrationTestBase->setUp();
         if (!$integrationTestBase->isEmulated()) {
             $serviceProperties = QueueServiceFunctionalTestData::getDefaultServiceProperties();
             $integrationTestBase->restProxy->setServiceProperties($serviceProperties);
         }
         self::$isOneTimeSetup = false;
     }
     parent::tearDownAfterClass();
 }
コード例 #2
0
 /**
  * @covers MicrosoftAzure\Storage\Queue\QueueRestProxy::setServiceProperties
  */
 public function testSetServicePropertiesNullOptions4()
 {
     $serviceProperties = QueueServiceFunctionalTestData::getDefaultServiceProperties();
     try {
         $this->restProxy->setServiceProperties($serviceProperties, null);
         $this->assertFalse($this->isEmulated(), 'service properties should throw in emulator');
     } catch (ServiceException $e) {
         if ($this->isEmulated()) {
             // Setting is not supported in emulator
             $this->assertEquals(TestResources::STATUS_BAD_REQUEST, $e->getCode(), 'getCode');
         } else {
             throw $e;
         }
     }
 }
コード例 #3
0
 private function verifyServicePropertiesWorker($ret, $serviceProperties)
 {
     if (is_null($serviceProperties)) {
         $serviceProperties = QueueServiceFunctionalTestData::getDefaultServiceProperties();
     }
     $sp = $ret->getValue();
     $this->assertNotNull($sp, 'getValue should be non-null');
     $l = $sp->getLogging();
     $this->assertNotNull($l, 'getValue()->getLogging() should be non-null');
     $this->assertEquals($serviceProperties->getLogging()->getVersion(), $l->getVersion(), 'getValue()->getLogging()->getVersion');
     $this->assertEquals($serviceProperties->getLogging()->getDelete(), $l->getDelete(), 'getValue()->getLogging()->getDelete');
     $this->assertEquals($serviceProperties->getLogging()->getRead(), $l->getRead(), 'getValue()->getLogging()->getRead');
     $this->assertEquals($serviceProperties->getLogging()->getWrite(), $l->getWrite(), 'getValue()->getLogging()->getWrite');
     $r = $l->getRetentionPolicy();
     $this->assertNotNull($r, 'getValue()->getLogging()->getRetentionPolicy should be non-null');
     $this->assertEquals($serviceProperties->getLogging()->getRetentionPolicy()->getDays(), $r->getDays(), 'getValue()->getLogging()->getRetentionPolicy()->getDays');
     $m = $sp->getMetrics();
     $this->assertNotNull($m, 'getValue()->getMetrics() should be non-null');
     $this->assertEquals($serviceProperties->getMetrics()->getVersion(), $m->getVersion(), 'getValue()->getMetrics()->getVersion');
     $this->assertEquals($serviceProperties->getMetrics()->getEnabled(), $m->getEnabled(), 'getValue()->getMetrics()->getEnabled');
     $this->assertEquals($serviceProperties->getMetrics()->getIncludeAPIs(), $m->getIncludeAPIs(), 'getValue()->getMetrics()->getIncludeAPIs');
     $r = $m->getRetentionPolicy();
     $this->assertNotNull($r, 'getValue()->getMetrics()->getRetentionPolicy should be non-null');
     $this->assertEquals($serviceProperties->getMetrics()->getRetentionPolicy()->getDays(), $r->getDays(), 'getValue()->getMetrics()->getRetentionPolicy()->getDays');
 }