|
|
@@ -27,9 +27,6 @@
|
|
|
require_once 'Zend/Db/Select/TestCommon.php';
|
|
|
|
|
|
|
|
|
-PHPUnit_Util_Filter::addFileToFilter(__FILE__);
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* @category Zend
|
|
|
* @package Zend_Db
|
|
|
@@ -511,7 +508,7 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
|
|
|
/**
|
|
|
* Test if the quotation type could be passed
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectHavingQuoteBySpecificType()
|
|
|
@@ -519,14 +516,14 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', '1', Zend_Db::INT_TYPE);
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > 1)', $select->__toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Test if the quotation is done for int
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectHavingQuoteAsIntAutomatically()
|
|
|
@@ -534,14 +531,14 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', 1);
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > 1)', $select->__toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Test if the quotation is done for string
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectHavingQuoteAsStringAutomatically()
|
|
|
@@ -549,14 +546,14 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', '1');
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > \'1\')', $select->__toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Test if the quotation type could be passed
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectOrHavingQuoteBySpecificType()
|
|
|
@@ -564,15 +561,15 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', '1', Zend_Db::INT_TYPE);
|
|
|
$select->orHaving('COUNT(*) = ?', '2', Zend_Db::INT_TYPE);
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > 1) OR (COUNT(*) = 2)', $select->__toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Test if the quotation is done for int
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectOrHavingQuoteAsIntAutomatically()
|
|
|
@@ -580,15 +577,15 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', 1);
|
|
|
$select->orHaving('COUNT(*) = ?', 2);
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > 1) OR (COUNT(*) = 2)', $select->__toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Test if the quotation is done for string
|
|
|
- *
|
|
|
+ *
|
|
|
* @group ZF-10000
|
|
|
*/
|
|
|
public function testSelectOrHavingQuoteAsStringAutomatically()
|
|
|
@@ -596,7 +593,7 @@ class Zend_Db_Select_StaticTest extends Zend_Db_Select_TestCommon
|
|
|
$select = $this->_select()
|
|
|
->columns(array('count' => 'COUNT(*)'))
|
|
|
->group('bug_id');
|
|
|
-
|
|
|
+
|
|
|
$select->having('COUNT(*) > ?', '1');
|
|
|
$select->orHaving('COUNT(*) = ?', '2');
|
|
|
$this->assertEquals('SELECT "zfproducts".*, COUNT(*) AS "count" FROM "zfproducts" GROUP BY "bug_id" HAVING (COUNT(*) > \'1\') OR (COUNT(*) = \'2\')', $select->__toString());
|