summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wehner2011-03-13 09:27:36 (GMT)
committer Daniel Wehner2011-03-13 09:27:36 (GMT)
commit3e86b313e15b6698962faa130af329d3d7d6a1e0 (patch)
tree3e18169645e5f4e7a1e0e8761a579c75120251fc
parent11876e3ec31bff6d5837204616159dae3208307b (diff)
#1090682 by dereine: Write a simpletest for the reset parameter of view::load.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--tests/views_view.test49
2 files changed, 50 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1bd5e9a..69919b7 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -109,6 +109,7 @@ by dereine: Convert op_shorter/longer in filter_string to add_where_expression.
#1052896 by dereine: Fix summary css classes output.
#1046674 by dereine: Rename build_mode to view_mode in row_node_view. This fixes some bugs with code using $node->view_mode.
#1090682 by febbraro: view:load does not clear the cache correctly when reset.
+#1090682 by dereine: Write a simpletest for the reset parameter of view::load.
Views 3.x-7.x-alpha1 (05-Jan-2011)
==================================
diff --git a/tests/views_view.test b/tests/views_view.test
index cc5a7de..51b4215 100644
--- a/tests/views_view.test
+++ b/tests/views_view.test
@@ -53,6 +53,20 @@ class viewsViewTest extends ViewsSqlTest {
$this->assertEqual($view->attachment_after, '');
}
+ function testDelete() {
+ // Delete a database view
+ $view = $this->view_test_delete();
+ $view->save();
+ $view = views_get_view($view->name);
+ $view->delete();
+
+ $view = views_get_view($view->name);
+ $this->assertNotNull($view, 'Take sure that the old view is still in the static cache.');
+
+ $view = views_get_view($view->name, TRUE);
+ $this->assertNull($view, "Take sure that the old view get's cleared by the reset parameter.");
+ }
+
/**
* This view provides some filters, fields, arguments, relationships, sorts, areas and attachments.
*/
@@ -216,4 +230,39 @@ class viewsViewTest extends ViewsSqlTest {
return $view;
}
+ function view_test_delete() {
+ $view = new view;
+ $view->name = 'test_view_delete';
+ $view->description = '';
+ $view->tag = '';
+ $view->base_table = 'node';
+ $view->human_name = 'test_view_delete';
+ $view->core = 7;
+ $view->api_version = '3.0-alpha1';
+ $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Defaults */
+ $handler = $view->new_display('default', 'Defaults', 'default');
+ $handler->display->display_options['access']['type'] = 'none';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'fields';
+ $translatables['test_view_delete'] = array(
+ t('Defaults'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort By'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ );
+
+ return $view;
+ }
} \ No newline at end of file