X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fphp%2Fsrc%2FTests%2FPlugin%2Fviews%2FPhpArgumentValidatorTest.php;fp=web%2Fmodules%2Fcontrib%2Fphp%2Fsrc%2FTests%2FPlugin%2Fviews%2FPhpArgumentValidatorTest.php;h=baa8e2cf0d669517d738ed006d93e16a3195d950;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/php/src/Tests/Plugin/views/PhpArgumentValidatorTest.php b/web/modules/contrib/php/src/Tests/Plugin/views/PhpArgumentValidatorTest.php new file mode 100644 index 000000000..baa8e2cf0 --- /dev/null +++ b/web/modules/contrib/php/src/Tests/Plugin/views/PhpArgumentValidatorTest.php @@ -0,0 +1,63 @@ +randomMachineName(); + $view = Views::getView('test_view_argument_validate_php'); + $view->setDisplay(); + $view->displayHandlers->get('default')->options['arguments']['null']['validate_options']['code'] = 'return $argument == \'' . $string . '\';'; + + $view->initHandlers(); + $this->assertTrue($view->argument['null']->validateArgument($string)); + // Reset saved argument validation. + $view->argument['null']->argument_validated = NULL; + $this->assertFalse($view->argument['null']->validateArgument($this->randomMachineName())); + } + +}