You are here

public function BlazyManagerBaseUnitTest::testBlazyManagerCreate in Blazy 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/BlazyManagerBaseUnitTest.php \Drupal\Tests\blazy\Unit\BlazyManagerBaseUnitTest::testBlazyManagerCreate()

@covers ::create @covers ::__construct

File

tests/src/Unit/BlazyManagerBaseUnitTest.php, line 35

Class

BlazyManagerBaseUnitTest
Tests the Blazy manager base.

Namespace

Drupal\Tests\blazy\Unit

Code

public function testBlazyManagerCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $exception = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
  $map = [
    [
      'entity_type.manager',
      $exception,
      $this->entityTypeManager,
    ],
    [
      'module_handler',
      $exception,
      $this->moduleHandler,
    ],
    [
      'renderer',
      $exception,
      $this->renderer,
    ],
    [
      'config.factory',
      $exception,
      $this->configFactory,
    ],
    [
      'cache.default',
      $exception,
      $this->cache,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $blazyManager = BlazyManager::create($container);
  $this
    ->assertInstanceOf(BlazyManager::class, $blazyManager);
}