BambooTwigConfigTest.php in Bamboo Twig 8.2
File
tests/src/Functional/BambooTwigConfigTest.php
View source
<?php
namespace Drupal\Tests\bamboo_twig\Functional;
class BambooTwigConfigTest extends BambooTwigTestBase {
public static $modules = [
'bamboo_twig',
'bamboo_twig_config',
'bamboo_twig_test',
];
private $hashSalt;
public function setUp() {
parent::setUp();
$this->hashSalt = $this->container
->get('settings')
->get('hash_salt');
}
public function testGetSettings() {
$this
->drupalGet('/bamboo-twig-config');
$this
->assertElementPresent('.test-configs div.config-settings');
$this
->assertElementContains('.test-configs div.config-settings', $this->hashSalt);
}
public function testGetConfig() {
$this
->drupalGet('/bamboo-twig-config');
$this
->assertElementPresent('.test-configs div.config-system');
$this
->assertElementContains('.test-configs div.config-system', 'simpletest@example.com');
}
public function testGetState() {
$state = $this->container
->get('state');
$this->time = $state
->get('system.cron_last');
$this
->drupalGet('/bamboo-twig-config');
$this
->assertElementPresent('.test-configs div.config-state');
$this
->assertElementContains('.test-configs div.config-state', $this->time);
}
}