Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / modules / contrib / blazy / tests / src / Unit / BlazyManagerBaseUnitTest.php
1 <?php
2
3 namespace Drupal\Tests\blazy\Unit;
4
5 use Drupal\blazy\BlazyManager;
6 use Drupal\Tests\UnitTestCase;
7 use Drupal\Tests\blazy\Traits\BlazyUnitTestTrait;
8 use Drupal\Tests\blazy\Traits\BlazyManagerUnitTestTrait;
9 use Symfony\Component\DependencyInjection\ContainerInterface;
10
11 /**
12  * Tests the Blazy manager base.
13  *
14  * @coversDefaultClass \Drupal\blazy\BlazyManagerBase
15  * @group blazy
16  */
17 class BlazyManagerBaseUnitTest extends UnitTestCase {
18
19   use BlazyUnitTestTrait;
20   use BlazyManagerUnitTestTrait;
21
22   /**
23    * {@inheritdoc}
24    */
25   protected function setUp() {
26     parent::setUp();
27
28     $this->setUpUnitServices();
29   }
30
31   /**
32    * @covers ::create
33    * @covers ::__construct
34    */
35   public function testBlazyManagerCreate() {
36     $container = $this->getMock(ContainerInterface::class);
37     $exception = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
38
39     $map = [
40       ['entity_type.manager', $exception, $this->entityTypeManager],
41       ['module_handler', $exception, $this->moduleHandler],
42       ['renderer', $exception, $this->renderer],
43       ['config.factory', $exception, $this->configFactory],
44       ['cache.default', $exception, $this->cache],
45     ];
46
47     $container->expects($this->any())
48       ->method('get')
49       ->willReturnMap($map);
50
51     $blazyManager = BlazyManager::create($container);
52     $this->assertInstanceOf(BlazyManager::class, $blazyManager);
53   }
54
55 }