? .git
? help/localization.html
? plugins/views_plugin_localization.inc
? plugins/views_plugin_localization_core.inc
? plugins/views_plugin_localization_none.inc
Index: tests/views_groupby.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/tests/Attic/views_groupby.test,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 views_groupby.test
--- tests/views_groupby.test	22 Dec 2009 00:38:03 -0000	1.1.2.1
+++ tests/views_groupby.test	23 Dec 2009 16:49:10 -0000
@@ -187,5 +187,73 @@ class ViewsQueryGroupByTest extends View
     return $view;
   }
 
+  public function testGroupByCountOnlyFilters() {
+    // Check if GROUP BY and HAVING are included when a view
+    // Doesn't display SUM, COUNT, MAX... functions in SELECT statment
+    
+    $type1 = $this->drupalCreateContentType();
+    
+
+    $node_1 = array(
+      'type' => $type1->type,
+    );
+    for ($x = 0; $x < 10; $x++) {
+      $this->drupalCreateNode($node_1);
+    }
+    
+
+    $view = $this->viewsGroupByCountViewOnlyFilters();
+    $view->set_display('default');
+    $output = $view->execute_display();
+
+    $this->assertTrue(strpos($view->build_info['query'], 'GROUP BY'), t('Make sure that GROUP BY is in the query'));
+    $this->assertTrue(strpos($view->build_info['query'], 'HAVING'), t('Make sure that HAVING is in the query'));
+  }
+
+  function viewsGroupByCountViewOnlyFilters() {
+    $view = new view;
+    $view->name = 'group_by_in_filters';
+    $view->description = '';
+    $view->tag = '';
+    $view->view_php = '';
+    $view->base_table = 'node';
+    $view->is_cacheable = FALSE;
+    $view->api_version = 2;
+    $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['group_by'] = TRUE;
+    $handler->display->display_options['access']['type'] = 'none';
+    $handler->display->display_options['cache']['type'] = 'none';
+    $handler->display->display_options['exposed_form']['type'] = 'basic';
+    $handler->display->display_options['pager']['type'] = 'some';
+    $handler->display->display_options['style_plugin'] = 'default';
+    $handler->display->display_options['row_plugin'] = 'fields';
+    /* Field: Nodo: Tipo */
+    $handler->display->display_options['fields']['type']['id'] = 'type';
+    $handler->display->display_options['fields']['type']['table'] = 'node';
+    $handler->display->display_options['fields']['type']['field'] = 'type';
+    $handler->display->display_options['fields']['type']['alter']['alter_text'] = 0;
+    $handler->display->display_options['fields']['type']['alter']['make_link'] = 0;
+    $handler->display->display_options['fields']['type']['alter']['trim'] = 0;
+    $handler->display->display_options['fields']['type']['alter']['word_boundary'] = 1;
+    $handler->display->display_options['fields']['type']['alter']['ellipsis'] = 1;
+    $handler->display->display_options['fields']['type']['alter']['strip_tags'] = 0;
+    $handler->display->display_options['fields']['type']['alter']['html'] = 0;
+    $handler->display->display_options['fields']['type']['hide_empty'] = 0;
+    $handler->display->display_options['fields']['type']['empty_zero'] = 0;
+    $handler->display->display_options['fields']['type']['link_to_node'] = 0;
+    /* Filtrar: Nodo: Nid */
+    $handler->display->display_options['filters']['nid']['id'] = 'nid';
+    $handler->display->display_options['filters']['nid']['table'] = 'node';
+    $handler->display->display_options['filters']['nid']['field'] = 'nid';
+    $handler->display->display_options['filters']['nid']['group_type'] = 'count';
+    $handler->display->display_options['filters']['nid']['operator'] = '>';
+    $handler->display->display_options['filters']['nid']['value']['value'] = '3';
+
+    return $view;
+  }
+
 }
 
