You are here

class S3Client in AmazonS3 7.2

Same name in this branch
  1. 7.2 src/S3Client.php \Drupal\amazons3\S3Client
  2. 7.2 tests/Stub/S3Client.php \Drupal\amazons3Test\Stub\S3Client

Stub bootstrap functions.

@class S3Client @package Drupal\amazons3Test\Stub @codeCoverageIgnore

Hierarchy

Expanded class hierarchy of S3Client

2 files declare their use of S3Client
S3ClientTest.php in tests/S3ClientTest.php
StreamWrapperTest.php in tests/StreamWrapperTest.php

File

tests/Stub/S3Client.php, line 16

Namespace

Drupal\amazons3Test\Stub
View source
class S3Client extends \Drupal\amazons3\S3Client {
  use Bootstrap;
  protected static $factoryCalled = FALSE;
  public static function resetCalled() {
    static::$factoryCalled = FALSE;
  }

  /**
   * @return boolean
   */
  public static function isFactoryCalled() {
    return static::$factoryCalled;
  }

  /**
   * Override setCommandFactory to use our stub.
   *
   * @param \Aws\S3\S3Client $client
   */
  protected static function setCommandFactory($client) {
    $default = CompositeFactory::getDefaultChain($client);
    $default
      ->add(new AliasFactory($client, static::$commandAliases), 'Guzzle\\Service\\Command\\Factory\\ServiceDescriptionFactory');
    $client
      ->setCommandFactory($default);
  }

  /**
   * {@inheritdoc}
   */
  public static function factory($config = array(), $bucket = NULL) {
    static::$factoryCalled = TRUE;
    return parent::factory($config, $bucket);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Bootstrap::$variableData protected static property
Bootstrap::setVariableData public static function
Bootstrap::variable_get public static function Static version of variable_get() for testing.
S3Client::$commandAliases protected static property This set of commandAliases is a protected static with no getter on the S3Client class.
S3Client::$factoryCalled protected static property
S3Client::factory public static function Create a new S3Client using aws_key / aws_secret $conf variables. Overrides S3Client::factory
S3Client::getBucketLocation public static function Get the region for an S3Client for a specific bucket.
S3Client::isFactoryCalled public static function
S3Client::resetCalled public static function
S3Client::setCommandFactory protected static function Override setCommandFactory to use our stub. Overrides S3Client::setCommandFactory
S3Client::validateBucketExists public static function Validate that a bucket exists.