AccessBlockBrowserTest.php in Theme permission 8
File
tests/src/Functional/AccessBlockBrowserTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\theme_permission\Functional;
class AccessBlockBrowserTest extends ThemePermissionTestBase {
public function testIfAccessThemeBartik() {
$this
->userLogin([
'administer themes bartik',
]);
$this
->drupalGet('/admin/structure/block/list/bartik');
$this
->assertSession()
->statusCodeEquals(200);
}
public function testIfAccessDeniedThemeBartik() {
$this
->userLogin();
$this
->drupalGet("/admin/structure/block/list/bartik");
$this
->assertSession()
->statusCodeEquals(403);
}
public function testIfShowSeven() {
$this
->userLogin([
'administer themes bartik',
'administer themes seven',
]);
$this
->drupalGet('/admin/structure/block');
$this
->assertNotEmpty($this
->getSession()
->getPage()
->find('xpath', '//a[contains(@href, "/admin/structure/block/list/seven")]'));
}
public function testIfNotShowSeven() {
$this
->userLogin();
$this
->drupalGet("/admin/structure/block");
$this
->assertEmpty($this
->getSession()
->getPage()
->find('xpath', '//a[contains(@href, "/admin/structure/block/list/seven")]'));
}
}