public static $testViews =
['test_tokens', 'test_invalid_tokens'
];
/**
* Tests core token replacements generated from a view.
*/
public function testTokenReplacement() { $token_handler = \Drupal::
token();
$view = Views::
getView('test_tokens'
);
$view->
setDisplay('page_1'
);
// Force the view to span more than one page to better test page_count.
$view->display_handler->
getPlugin('pager'
)->
setItemsPerPage(4
);
$this->
executeView($view);
$expected =
[ '[view:label]' => 'Test tokens',
'[view:description]' => 'Test view to token replacement tests.',
'[view:id]' => 'test_tokens',
'[view:title]' => 'Test token page',
'[view:url]' =>
$view->
getUrl(NULL, 'page_1'
)->
setAbsolute(TRUE
)->
toString(),
'[view:total-rows]' => '5',
'[view:base-table]' => 'views_test_data',
'[view:base-field]' => 'id',