You are here

function ArgumentValidatorTest::testArgumentValidateNumeric in Views (for Drupal 7) 8.3

File

lib/Drupal/views/Tests/Plugin/ArgumentValidatorTest.php, line 36
Definition of Drupal\views\Tests\Plugin\ArgumentValidatorTest.

Class

ArgumentValidatorTest
Tests Views argument validators.

Namespace

Drupal\views\Tests\Plugin

Code

function testArgumentValidateNumeric() {
  $view = $this
    ->createViewFromConfig('test_view_argument_validate_numeric');
  $view
    ->preExecute();
  $view
    ->initHandlers();
  $this
    ->assertFalse($view->argument['null']
    ->validateArgument($this
    ->randomString()));

  // Reset safed argument validation.
  $view->argument['null']->argument_validated = NULL;
  $this
    ->assertTrue($view->argument['null']
    ->validateArgument(12));
}