function ViewExecutableTest::testArgumentValidatorValueOverride

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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 544

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']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.