You are here

public function ImportQueueItemTest::createContainer in Acquia Content Hub 8

Build a container before the class.

1 call to ImportQueueItemTest::createContainer()
ImportQueueItemTest::provideAuthorItems in tests/src/Unit/QueueItem/ImportQueueItemTest.php
Provides a series of queue items with dependencies.

File

tests/src/Unit/QueueItem/ImportQueueItemTest.php, line 181

Class

ImportQueueItemTest
PHPUnit test for the ImportQueueItem.

Namespace

Drupal\Tests\acquia_contenthub\Unit\QueueItem

Code

public function createContainer() {
  parent::setup();
  \Drupal::unsetContainer();
  $container = new ContainerBuilder();
  $account = $this
    ->getMockBuilder('Drupal\\Core\\Session\\AccountProxyInterface')
    ->disableOriginalConstructor()
    ->getMock();
  $container
    ->set('current_user', $account);
  \Drupal::setContainer($container);
}