ResponsivePreviewBlockTest.php in Responsive Theme Preview 8
File
tests/src/Functional/ResponsivePreviewBlockTest.php
View source
<?php
namespace Drupal\Tests\responsive_preview\Functional;
class ResponsivePreviewBlockTest extends ResponsivePreviewTestBase {
protected static $modules = [
'block',
];
public function testBlock() {
$devices = array_keys($this
->getDefaultDevices(TRUE));
$this
->placeBlock('responsive_preview_block');
$this
->drupalGet('');
$this
->assertSession()
->elementNotExists('css', '.block-responsive-preview');
$this
->assertNoResponsivePreviewLibrary();
$this
->assertNoResponsivePreviewCachesTagAndContexts();
$preview_user = $this
->drupalCreateUser([
'access responsive preview',
]);
$this
->drupalLogin($preview_user);
$this
->assertSession()
->elementExists('css', '.block-responsive-preview');
$this
->assertResponsivePreviewLibrary();
$this
->assertResponsivePreviewCachesTagAndContexts();
$this
->assertDeviceListEquals($devices);
}
}