/**
  * @covers WindowsAzure\Blob\BlobRestProxy::createContainer
  * @covers WindowsAzure\Blob\BlobRestProxy::deleteContainer
  * @covers WindowsAzure\Blob\BlobRestProxy::listContainers
  */
 public function setUp()
 {
     parent::setUp();
     $settings = StorageServiceSettings::createFromConnectionString($this->connectionString);
     $accountName = $settings->getBlobEndpointUri();
     $firstSlash = strpos($accountName, '/');
     $accountName = substr($accountName, $firstSlash + 2);
     $firstDot = strpos($accountName, '.');
     $accountName = substr($accountName, 0, $firstDot);
     BlobServiceFunctionalTestData::setupData($accountName);
     $hasRoot = false;
     foreach ($this->restProxy->listContainers()->getContainers() as $container) {
         if ($container->getName() == '$root') {
             $hasRoot = true;
             $this->safeDeleteContainerContents('$root');
         } else {
             $this->safeDeleteContainer($container->getName());
         }
     }
     foreach (BlobServiceFunctionalTestData::$testContainerNames as $name) {
         $this->safeCreateContainer($name);
     }
     if (!$hasRoot) {
         $this->safeCreateContainer('$root');
     }
     if (!self::$isOneTimeSetup) {
         self::$isOneTimeSetup = true;
     }
 }
 /**
  * @covers WindowsAzure\Blob\BlobRestProxy::createContainer
  * @covers WindowsAzure\Blob\BlobRestProxy::deleteContainer
  * @covers WindowsAzure\Blob\BlobRestProxy::listContainers
  */
 public function setUp()
 {
     parent::setUp();
     $accountName = $this->config->getProperty(BlobSettings::URI);
     $firstSlash = strpos($accountName, '/');
     $accountName = substr($accountName, $firstSlash + 2);
     $firstDot = strpos($accountName, '.');
     $accountName = substr($accountName, 0, $firstDot);
     BlobServiceFunctionalTestData::setupData($accountName);
     $hasRoot = false;
     foreach ($this->restProxy->listContainers()->getContainers() as $container) {
         if ($container->getName() == '$root') {
             $hasRoot = true;
             $this->safeDeleteContainerContents('$root');
         } else {
             $this->safeDeleteContainer($container->getName());
         }
     }
     foreach (BlobServiceFunctionalTestData::$TEST_CONTAINER_NAMES as $name) {
         $this->safeCreateContainer($name);
     }
     if (!$hasRoot) {
         $this->safeCreateContainer('$root');
     }
 }