DibaCarouselBlockTests.php in Diba carousel slider 8
File
tests/src/Functional/DibaCarouselBlockTests.php
View source
<?php
namespace Drupal\Tests\diba_carousel\Functional;
use Drupal\Tests\BrowserTestBase;
class DibaCarouselBlockTests extends BrowserTestBase {
public static $modules = [
'filter',
'help',
'diba_carousel',
];
protected $defaultTheme = 'stable';
protected $adminUser;
protected function setUp() {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser([
'administer site configuration',
'access administration pages',
'administer blocks',
]);
}
public function testDibaCarouselBlock() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/structure/block/library/stable');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->responseContains('Diba carousel');
$theme = \Drupal::service('theme_handler')
->getDefault();
$this
->drupalGet("admin/structure/block/add/diba_carousel/{$theme}");
$this
->assertSession()
->statusCodeEquals(200);
$this
->drupalGet('admin/help/diba_carousel');
$this
->assertSession()
->statusCodeEquals(200);
}
}