You are here

public function SlickAdminUnitTest::testBlazyAdminCreate in Slick Carousel 8.2

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

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

File

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

Class

SlickAdminUnitTest
Tests the Slick admin form.

Namespace

Drupal\Tests\slick\Unit\Form

Code

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