You are here

function ViewsArgumentValidatorTest::testArgumentValidatePhp in Views (for Drupal 7) 7.3

File

tests/views_argument_validator.test, line 20
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 safed argument validation.
  $view->argument['null']->argument_validated = NULL;
  $this
    ->assertFalse($view->argument['null']
    ->validate_arg($this
    ->randomName()));
}