/**
  * @throws AuthenticationFailedException
  * @throws UnexpectedHttpStatusException
  */
 protected function setUp()
 {
     parent::setUp();
     $config = (include __DIR__ . '/../data/config.php');
     $this->container = new Container($config['container_name']);
     $this->containerUrl = $config['container_url'];
     $this->containerSecretKey = $config['container_secret_key'];
     $this->auth = new CredentialsAuthentication($config['auth_user'], $config['auth_key'], $config['auth_url']);
     $this->auth->authenticate();
     $this->service = new StorageService($this->auth);
     $this->testFileName = __DIR__ . '/../data/test_file.txt';
 }
 /**
  * @param string                  $method    HTTP method
  * @param Container               $container Container for the request
  * @param ServerResourceInterface $file      Object for the request
  *
  * @return RequestInterface
  * @throws Exception
  */
 protected function createHttpRequest($method, Container $container, ServerResourceInterface $file)
 {
     $url = $this->authentication->getStorageUrl() . '/' . $container->getName() . '/' . $file->getServerName();
     $request = $this->httpClient->createRequest($method, $url, ['exceptions' => false]);
     $request->addHeader('X-Auth-Token', $this->authentication->getAuthToken());
     return $request;
 }