BlazyGridUnitTest.php in Blazy 8
File
tests/src/Unit/BlazyGridUnitTest.php
View source
<?php
namespace Drupal\Tests\blazy\Unit;
use Drupal\Tests\UnitTestCase;
use Drupal\blazy\BlazyGrid;
class BlazyGridUnitTest extends UnitTestCase {
public function testBuild() {
$settings['grid'] = 4;
$settings['grid_medium'] = 3;
$settings['grid_small'] = 2;
$settings['grid_item_class'] = 'grid--test';
$settings['image_style'] = 'blazy_crop';
$settings['media_switch'] = 'media';
$settings['style'] = 'grid';
$settings['type'] = 'image';
$items = [];
foreach (range(1, 3) as $key) {
$items[] = '<img src="/core/misc/druplicon.png" alt="thumbnail ' . $key . '">';
}
$element = BlazyGrid::build($items, $settings);
$this
->assertEquals('item_list', $element['#theme']);
}
}