You are here

protected function AcquiadamClientFactoryTest::setUp in Media: Acquia DAM 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/AcquiadamClientFactoryTest.php, line 67

Class

AcquiadamClientFactoryTest
Client factory test.

Namespace

Drupal\Tests\media_acquiadam\Unit

Code

protected function setUp() {
  parent::setUp();
  $current_user = $this
    ->getMockBuilder(AccountProxyInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $http_client = $this
    ->getMockBuilder(ClientInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $user_data = $this
    ->getMockBuilder(UserDataInterface::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->container = new ContainerBuilder();
  $this->container
    ->set('string_translation', $this
    ->getStringTranslationStub());
  $this->container
    ->set('config.factory', $this
    ->getConfigFactoryStub());
  $this->container
    ->set('http_client', $http_client);
  $this->container
    ->set('user.data', $user_data);
  $this->container
    ->set('current_user', $current_user);
  \Drupal::setContainer($this->container);
  $this->clientFactory = ClientFactory::create($this->container);
}