You are here

public function GridStackAdminUnitTest::testBlazyAdminCreate in GridStack 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/Form/GridStackAdminUnitTest.php \Drupal\Tests\gridstack\Unit\Form\GridStackAdminUnitTest::testBlazyAdminCreate()

@covers ::create @covers ::__construct @covers ::blazyAdmin @covers ::manager

File

tests/src/Unit/Form/GridStackAdminUnitTest.php, line 35

Class

GridStackAdminUnitTest
Tests the GridStack admin form.

Namespace

Drupal\Tests\gridstack\Unit\Form

Code

public function testBlazyAdminCreate() {
  $container = $this
    ->createMock(ContainerInterface::class);
  $exception = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
  $map = [
    [
      'blazy.admin.extended',
      $exception,
      $this->blazyAdminExtended,
    ],
    [
      'gridstack.manager',
      $exception,
      $this->gridstackManager,
    ],
  ];
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $gridstackAdmin = GridStackAdmin::create($container);
  $this
    ->assertInstanceOf(GridStackAdmin::class, $gridstackAdmin);
  $this
    ->assertInstanceOf('\\Drupal\\blazy\\Dejavu\\BlazyAdminExtended', $gridstackAdmin
    ->blazyAdmin());
  $this
    ->assertInstanceOf('\\Drupal\\gridstack\\GridStackManagerInterface', $gridstackAdmin
    ->manager());
}