summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test
index 39e54e7..9c0a7eb 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_argument_default.test
@@ -1,6 +1,11 @@
<?php
/**
+ * @file
+ * Definition of ViewsArgumentDefaultTest.
+ */
+
+/**
* Basic test for pluggable argument default.
*/
class ViewsArgumentDefaultTest extends ViewsSqlTest {
@@ -19,7 +24,32 @@ class ViewsArgumentDefaultTest extends ViewsSqlTest {
}
/**
- * Test fixed default argument.
+ * Tests the use of a default argument plugin that provides no options.
+ */
+ function testArgumentDefaultNoOptions() {
+ module_enable(array('views_ui', 'views_test'));
+ $admin_user = $this->drupalCreateUser(array('administer views', 'administer site configuration'));
+ $this->drupalLogin($admin_user);
+
+ // The current_user plugin has no options form, and should pass validation.
+ $argument_type = 'current_user';
+ $edit = array(
+ 'options[default_argument_type]' => $argument_type,
+ );
+ $this->drupalPost('admin/structure/views/nojs/config-item/test_argument_default_current_user/default/argument/uid', $edit, t('Apply'));
+
+ // Note, the undefined index error has two spaces after it.
+ $error = array(
+ '%type' => 'Notice',
+ '!message' => 'Undefined index: ' . $argument_type,
+ '%function' => 'views_handler_argument->options_validate()',
+ );
+ $message = t('%type: !message in %function', $error);
+ $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message)));
+ }
+
+ /**
+ * Tests fixed default argument.
*/
function testArgumentDefaultFixed() {
$view = $this->view_argument_default_fixed();