|
|
@@ -6860,6 +6860,17 @@ class ModelReadTest extends BaseModelTest {
|
|
|
));
|
|
|
$result = $Article->find('count', array('group' => array('Article.user_id')));
|
|
|
$this->assertEquals($expected, $result);
|
|
|
+
|
|
|
+ $expected = count($Article->find('all', array(
|
|
|
+ 'fields' => array('Article.user_id'),
|
|
|
+ 'conditions' => array('Article.user_id' => 1),
|
|
|
+ 'group' => 'Article.user_id')
|
|
|
+ ));
|
|
|
+ $result = $Article->find('count', array(
|
|
|
+ 'conditions' => array('Article.user_id' => 1),
|
|
|
+ 'group' => array('Article.user_id'),
|
|
|
+ ));
|
|
|
+ $this->assertEquals($expected, $result);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -6886,7 +6897,7 @@ class ModelReadTest extends BaseModelTest {
|
|
|
$this->skipIf($this->db instanceof Sqlite, 'SELECT COUNT(DISTINCT field) is not compatible with SQLite.');
|
|
|
$this->skipIf($this->db instanceof Sqlserver, 'This test is not compatible with SQL Server.');
|
|
|
|
|
|
- $this->loadFixtures('Project');
|
|
|
+ $this->loadFixtures('Project', 'Thread');
|
|
|
$TestModel = new Project();
|
|
|
$TestModel->create(array('name' => 'project')) && $TestModel->save();
|
|
|
$TestModel->create(array('name' => 'project')) && $TestModel->save();
|