summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTasso Evangelista <[email protected]>2013-05-08 02:13:26 -0300
committerTasso Evangelista <[email protected]>2013-05-08 02:13:26 -0300
commitd1a02c523a468a021b20d417be8bb1bd38755248 (patch)
tree6f94b403e099d12a5cb66c8e0c4647fc0e4ca0c2 /test
parent01112f5ac14b24aed8038cc0ae99801007ef26b8 (diff)
Ignore result columns when calling a aggregate function
Diffstat (limited to 'test')
-rw-r--r--test/QueryBuilderTest.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/QueryBuilderTest.php b/test/QueryBuilderTest.php
index bd888c0..6888c85 100644
--- a/test/QueryBuilderTest.php
+++ b/test/QueryBuilderTest.php
@@ -477,6 +477,12 @@ class QueryBuilderTest extends PHPUnit_Framework_TestCase {
$expected = "SELECT COUNT(*) AS `count` FROM `widget` LIMIT 1";
$this->assertEquals($expected, ORM::get_last_query());
}
+
+ public function testIgnoreSelectAndCount() {
+ ORM::for_table('widget')->select('test')->count();
+ $expected = "SELECT COUNT(*) AS `count` FROM `widget` LIMIT 1";
+ $this->assertEquals($expected, ORM::get_last_query());
+ }
public function testMax() {
ORM::for_table('person')->max('height');