class GridStackSkinManagerTest in GridStack 8.2
Tests the GridStack skin manager methods.
@coversDefaultClass \Drupal\gridstack\GridStackSkinManager
@group gridstack
Hierarchy
- class \Drupal\Tests\gridstack\Kernel\GridStackSkinManagerTest extends \Drupal\Tests\blazy\Kernel\BlazyKernelTestBase uses GridStackUnitTestTrait
Expanded class hierarchy of GridStackSkinManagerTest
File
- tests/
src/ Kernel/ GridStackSkinManagerTest.php, line 15
Namespace
Drupal\Tests\gridstack\KernelView source
class GridStackSkinManagerTest extends BlazyKernelTestBase {
use GridStackUnitTestTrait;
/**
* {@inheritdoc}
*/
public static $modules = [
'system',
'user',
'field',
'file',
'filter',
'image',
'node',
'text',
'blazy',
'gridstack',
'gridstack_ui',
'gridstack_test',
];
/**
* {@inheritdoc}
*/
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');
}
/**
* Tests cases for various methods.
*
* @covers ::getSkins
* @covers ::getCache
* @covers ::libraryInfoBuild
*/
public function testGridStackManagerMethods() {
$manager = $this->gridstackSkinManager;
// Tests for skins.
$skins = $manager
->getSkins();
$this
->assertArrayHasKey('default', $skins);
// Verify we have cached skins.
$cid = 'gridstack_skins_data';
$cached_skins = $manager
->getCache()
->get($cid);
$this
->assertEquals($cid, $cached_skins->cid);
$this
->assertEquals($skins, $cached_skins->data);
// Verify libraries.
$libraries = $manager
->libraryInfoBuild();
$this
->assertArrayHasKey('gridstack.default', $libraries);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GridStackSkinManagerTest:: |
public static | property | ||
GridStackSkinManagerTest:: |
protected | function | ||
GridStackSkinManagerTest:: |
public | function | Tests cases for various methods. | |
GridStackUnitTestTrait:: |
protected | function | Defines scoped definition. |