GridStackSkinManagerTest.php in GridStack 8.2
File
tests/src/Kernel/GridStackSkinManagerTest.php
View source
<?php
namespace Drupal\Tests\gridstack\Kernel;
use Drupal\Tests\blazy\Kernel\BlazyKernelTestBase;
use Drupal\Tests\gridstack\Traits\GridStackUnitTestTrait;
class GridStackSkinManagerTest extends BlazyKernelTestBase {
use GridStackUnitTestTrait;
public static $modules = [
'system',
'user',
'field',
'file',
'filter',
'image',
'node',
'text',
'blazy',
'gridstack',
'gridstack_ui',
'gridstack_test',
];
protected function setUp() {
parent::setUp();
$this
->installConfig([
'field',
'image',
'media',
'responsive_image',
'node',
'views',
'blazy',
'gridstack',
'gridstack_ui',
]);
$this->gridstackSkinManager = $this->container
->get('gridstack.skin_manager');
}
public function testGridStackManagerMethods() {
$manager = $this->gridstackSkinManager;
$skins = $manager
->getSkins();
$this
->assertArrayHasKey('default', $skins);
$cid = 'gridstack_skins_data';
$cached_skins = $manager
->getCache()
->get($cid);
$this
->assertEquals($cid, $cached_skins->cid);
$this
->assertEquals($skins, $cached_skins->data);
$libraries = $manager
->libraryInfoBuild();
$this
->assertArrayHasKey('gridstack.default', $libraries);
}
}