public function BambooTwigSecurityTest::testHasPermissions in Bamboo Twig 8.4
Same name in this branch
- 8.4 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::testHasPermissions()
- 8.4 tests/src/Kernel/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Kernel\BambooTwigSecurityTest::testHasPermissions()
Same name and namespace in other branches
- 8.5 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::testHasPermissions()
@covers Drupal\bamboo_twig_security\TwigExtension\Security::hasPermissions
File
- tests/
src/ Functional/ BambooTwigSecurityTest.php, line 109
Class
- BambooTwigSecurityTest
- Tests Security twig filters and functions.
Namespace
Drupal\Tests\bamboo_twig\FunctionalCode
public function testHasPermissions() {
$this
->drupalGet('/bamboo-twig-security');
$this
->assertElementPresent('.test-security div.security-permissions-current');
$this
->assertElementContains('.test-security div.security-permissions-current', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-admin');
$this
->assertElementContains('.test-security div.security-permissions-admin', 'TRUE');
$this
->assertElementPresent('.test-security div.security-permissions-user-none-or');
$this
->assertElementContains('.test-security div.security-permissions-user-none-or', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-user-none-and');
$this
->assertElementContains('.test-security div.security-permissions-user-none-and', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-nobody-or');
$this
->assertElementContains('.test-security div.security-permissions-nobody-or', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-nobody-and');
$this
->assertElementContains('.test-security div.security-permissions-nobody-and', 'FALSE');
$this
->drupalLogin($this->admin_user);
$this
->drupalGet('/bamboo-twig-security');
$this
->assertElementPresent('.test-security div.security-permissions-current');
$this
->assertElementContains('.test-security div.security-permissions-current', 'TRUE');
$this
->assertElementPresent('.test-security div.security-permissions-admin');
$this
->assertElementContains('.test-security div.security-permissions-admin', 'TRUE');
$this
->assertElementPresent('.test-security div.security-permissions-user-none-or');
$this
->assertElementContains('.test-security div.security-permissions-user-none-or', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-user-none-and');
$this
->assertElementContains('.test-security div.security-permissions-user-none-and', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-nobody-or');
$this
->assertElementContains('.test-security div.security-permissions-nobody-or', 'FALSE');
$this
->assertElementPresent('.test-security div.security-permissions-nobody-and');
$this
->assertElementContains('.test-security div.security-permissions-nobody-and', 'FALSE');
}