BlazyManagerBaseUnitTest.php in Blazy 8
File
tests/src/Unit/BlazyManagerBaseUnitTest.php
View source
<?php
namespace Drupal\Tests\blazy\Unit;
use Drupal\blazy\BlazyManager;
use Drupal\Tests\UnitTestCase;
use Drupal\Tests\blazy\Traits\BlazyUnitTestTrait;
use Drupal\Tests\blazy\Traits\BlazyManagerUnitTestTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
class BlazyManagerBaseUnitTest extends UnitTestCase {
use BlazyUnitTestTrait;
use BlazyManagerUnitTestTrait;
protected function setUp() {
parent::setUp();
$this
->setUpUnitServices();
}
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);
}
}