function ViewsArgumentDefaultTest::testArgumentDefaultFixed
Tests fixed default argument.
File
-
tests/
views_argument_default.test, line 61
Class
- ViewsArgumentDefaultTest
- Basic test for pluggable argument default.
Code
public function testArgumentDefaultFixed() {
$view = $this->view_argument_default_fixed();
$view->set_display('default');
$view->pre_execute();
$view->init_handlers();
$this->assertEqual($view->argument['null']
->get_default_argument(), $this->random, 'Fixed argument should be used by default.');
$view->destroy();
// Make sure that a normal argument provided is used.
$view = $this->view_argument_default_fixed();
$view->set_display('default');
$random_string = $this->randomString();
$view->execute_display('default', array(
$random_string,
));
$this->assertEqual($view->args[0], $random_string, 'Provided argument should be used.');
}