BambooTwigTokenTest.php in Bamboo Twig 8.2
File
tests/src/Functional/BambooTwigTokenTest.php
View source
<?php
namespace Drupal\Tests\bamboo_twig\Functional;
class BambooTwigTokenTest extends BambooTwigTestBase {
public static $modules = [
'bamboo_twig',
'bamboo_twig_token',
'bamboo_twig_loader',
'bamboo_twig_test',
'node',
];
public function setUp() {
parent::setUp();
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
$this->article = $this
->drupalCreateNode([
'title' => 'Hello, world!',
'type' => 'article',
]);
$this->article
->save();
$this->container
->get('router.builder')
->rebuild();
}
public function testSubstituteToken() {
$this
->drupalGet('/bamboo-twig-token');
$this
->assertElementPresent('.test-token div.token-site');
$this
->assertElementContains('.test-token div.token-site', 'Drupal');
$this
->assertElementPresent('.test-token div.token-node');
$this
->assertElementContains('.test-token div.token-node', 'Hello, world!');
}
}