You are here

public function BambooTwigSecurityTest::testCurrentUser in Bamboo Twig 8

@covers Drupal\bamboo_twig_security\TwigExtension\Security::getCurrentUser

File

tests/src/Functional/BambooTwigSecurityTest.php, line 43

Class

BambooTwigSecurityTest
Tests Security twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testCurrentUser() {
  $this
    ->drupalGet('/bamboo-twig-security');
  $this
    ->assertElementPresent('.test-security div.security-current-user');
  $this
    ->assertElementContains('.test-security div.security-current-user', '');
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('/bamboo-twig-security');
  $this
    ->assertElementPresent('.test-security div.security-current-user');
  $this
    ->assertElementContains('.test-security div.security-current-user', $this->admin_user
    ->getUsername());
}