You are here

public function ViewsQueryGroupByTest::testAggregateAmbiguity in Views (for Drupal 7) 7.3

File

tests/views_groupby.test, line 25
Definitions of ViewsQueryGroupByTest and ViewsUiGroupbyTestCase.

Class

ViewsQueryGroupByTest
Tests aggregate functionality of views, for example count.

Code

public function testAggregateAmbiguity() {

  // Create 4 nodes of type1
  $type1 = $this
    ->drupalCreateContentType();
  $node_1 = array(
    'type' => $type1->type,
  );
  $this
    ->drupalCreateNode($node_1);
  $this
    ->drupalCreateNode($node_1);
  $this
    ->drupalCreateNode($node_1);
  $this
    ->drupalCreateNode($node_1);
  $view = $this
    ->viewsAggregateAmbiguityView();
  $output = $view
    ->execute_display();
  $this
    ->assertEqual(count($view->result), 1, 'Make sure there are no ambiguity problems with the group by operation.');
}