You are here

public function ViewExecutableTest::testArgumentValidatorValueOverride in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testArgumentValidatorValueOverride()
  2. 10 core/modules/views/tests/src/Kernel/ViewExecutableTest.php \Drupal\Tests\views\Kernel\ViewExecutableTest::testArgumentValidatorValueOverride()

Tests if argument overrides by validators are propagated to tokens.

File

core/modules/views/tests/src/Kernel/ViewExecutableTest.php, line 541

Class

ViewExecutableTest
Tests the ViewExecutable class.

Namespace

Drupal\Tests\views\Kernel

Code

public function testArgumentValidatorValueOverride() {
  $view = Views::getView('test_argument_dependency');
  $view
    ->setDisplay('page_1');
  $view
    ->setArguments([
    '1',
    'this value should be replaced',
  ]);
  $view
    ->execute();
  $expected = [
    '{{ arguments.uid }}' => '1',
    '{{ raw_arguments.uid }}' => '1',
  ];
  $this
    ->assertEquals($expected, $view->build_info['substitutions']);
}