1 views_argument_validator.test ViewsArgumentValidatorTest::testArgumentValidatePhp()

File

core/modules/views/tests/views_argument_validator.test, line 13
Definition of ViewsArgumentValidatorTest.

Class

ViewsArgumentValidatorTest
Tests Views argument validators.

Code

function testArgumentValidatePhp() {
  $string = $this->randomName();
  $view = $this->view_test_argument_validate_php($string);
  $view->set_display('default');
  $view->pre_execute();
  $view->init_handlers();
  $this->assertTrue($view->argument['null']->validate_arg($string));
  // Reset safe argument validation.
  $view->argument['null']->argument_validated = NULL;
  $this->assertFalse($view->argument['null']->validate_arg($this->randomName()));
}