function ViewsQueryGroupByTest::testAggregateAmbiguity

Tests ambiguous group by column error (postgresql)

File

tests/views_groupby.test, line 27

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();
  $view->execute_display();
  $this->assertEqual(count($view->result), 1, 'Make sure there are no ambiguity problems with the group by operation.');
}