summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
commit8a7a4f8e58df35a10fda833a9904eb8fd961a1ca (patch)
tree35e2f907372d637f76c0e3c3ac1c0f27f2dc1391 /kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test
parent146e20fc2d0941a6783641f26b3ea074dc03fc84 (diff)
downloadkolab.org-www-8a7a4f8e58df35a10fda833a9904eb8fd961a1ca.tar.gz
upgrade to drupal 7.15
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test
new file mode 100644
index 0000000..9bd7922
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_analyze.test
@@ -0,0 +1,48 @@
+<?php
+
+/**
+ * @file
+ * Tests the views analyze system.
+ */
+
+class ViewsAnalyzeTest extends ViewsSqlTest {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Views Analyze',
+ 'description' => 'Test the views analyze system.',
+ 'group' => 'Views',
+ );
+ }
+
+ public function setUp() {
+ parent::setUp('views_ui');
+ module_enable(array('views_ui'));
+ // @TODO Figure out why it's required to clear the cache here.
+ views_module_include('views_default', TRUE);
+ views_get_all_views(TRUE);
+ menu_rebuild();
+
+ // Add an admin user will full rights;
+ $this->admin = $this->drupalCreateUser(array('administer views'));
+ }
+
+ /**
+ * Tests that analyze works in general.
+ */
+ function testAnalyzeBasic() {
+ $this->drupalLogin($this->admin);
+ // Enable the frontpage view and click the analyse button.
+ $view = views_get_view('frontpage');
+ $view->save();
+
+ $this->drupalGet('admin/structure/views/view/frontpage/edit');
+ $this->assertLink(t('analyze view'));
+
+ // This redirects the user to the form.
+ $this->clickLink(t('analyze view'));
+ $this->assertText(t('View analysis'));
+
+ // This redirects the user back to the main views edit page.
+ $this->drupalPost(NULL, array(), t('Ok'));
+ }
+}