You are here

public function BambooTwigLoaderTest::testCurrentUser in Bamboo Twig 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testCurrentUser()
  2. 8.2 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testCurrentUser()
  3. 8.3 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testCurrentUser()

@covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadCurrentUser

File

tests/src/Functional/BambooTwigLoaderTest.php, line 68

Class

BambooTwigLoaderTest
Tests Loaders twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

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