TokenViewsFilterTest.php in Tokens in Views Filter Criteria 8
File
tests/src/Functional/TokenViewsFilterTest.php
View source
<?php
namespace Drupal\Tests\token_views_filter\Functional;
use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\Tests\ViewTestData;
class TokenViewsFilterTest extends ViewTestBase {
public static $testViews = [
'test_token_filter',
];
public static $modules = [
'views_ui',
'token_views_filter',
'token_views_filter_test',
];
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
if ($import_test_views) {
ViewTestData::createTestViews(get_class($this), [
'token_views_filter_test',
]);
}
$this
->enableViewsTestModule();
$this->adminUser = $this
->drupalCreateUser([
'administer views',
]);
$this
->drupalLogin($this->adminUser);
}
public function testFormFieldStringUseTokenExists() {
$this
->drupalGet('admin/structure/views/nojs/handler/test_token_filter/default/filter/test_filter_string');
$this
->assertSession()
->fieldExists('options[use_tokens]');
}
public function testFormFieldNumericUseTokenExists() {
$this
->drupalGet('admin/structure/views/nojs/handler/test_token_filter/default/filter/test_filter_numeric');
$this
->assertSession()
->fieldExists('options[use_tokens]');
}
}