Tests count query.
protected function testCount() {
// Test count on no conditions.
$count = $this->factory
->get('config_query_test')
->count()
->execute();
$this
->assertIdentical($count, count($this->entities));
// Test count on a complex query.
$query = $this->factory
->get('config_query_test', 'OR');
$and_condition_1 = $query
->andConditionGroup()
->condition('id', 1)
->condition('label', $this->entities[0]->label);
$and_condition_2 = $query
->andConditionGroup()
->condition('id', '2')
->condition('label', $this->entities[1]->label);
$count = $query
->condition($and_condition_1)
->condition($and_condition_2)
->count()
->execute();
$this
->assertIdentical($count, 2);
}