public function MetatagViewsTokenTest::testTokenization in Metatag 8
Confirm the Views tokenization functionality works, including UI.
File
- metatag_views/
tests/ src/ Functional/ MetatagViewsTokenTest.php, line 49
Class
- MetatagViewsTokenTest
- Confirm the tokenization functionality works.
Namespace
Drupal\Tests\metatag_views\FunctionalCode
public function testTokenization() {
$this
->loginUser1();
$page_path = $this
->randomMachineName();
$this
->drupalGet('/admin/structure/views/add');
$edit = [
'label' => $this
->randomString(),
'id' => 'test',
'page[create]' => 1,
'page[path]' => $page_path,
'page[style][row_plugin]' => 'titles',
];
$this
->submitForm($edit, 'Save and edit');
$title_prefix = $this
->updateView(TRUE);
$node_title = $this
->randomString();
$this
->createContentTypeNode($node_title);
$this
->drupalGet("/{$page_path}");
$this
->assertSession()
->titleEquals("{$title_prefix} {$node_title}");
// Test caching by asserting a change of the View changes the page as well.
$title_prefix = $this
->updateView();
$this
->drupalGet("/{$page_path}");
$this
->assertSession()
->titleEquals("{$title_prefix} {$node_title}");
$this
->drupalGet("/{$page_path}");
$this
->assertSession()
->titleEquals("{$title_prefix} {$node_title}");
}