Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

"CActiveRecordTest::testCountWithHavingRelational()" has been updated…

… exposing issue #2201
  • Loading branch information...
commit 783a2ea6f64f3ffab01b42268445f6c91b376fe1 1 parent b8eaab4
@klimov-paul klimov-paul authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 tests/framework/db/ar/CActiveRecordTest.php
View
4 tests/framework/db/ar/CActiveRecordTest.php
@@ -1416,6 +1416,7 @@ public function testCountWithHaving()
/**
* @see https://github.com/yiisoft/yii/issues/135
+ * @see https://github.com/yiisoft/yii/issues/2201
*/
public function testCountWithHavingRelational()
{
@@ -1423,7 +1424,8 @@ public function testCountWithHavingRelational()
$criteriaWithHaving->select = 't.id AS test_field';
$criteriaWithHaving->with = array('author');
$criteriaWithHaving->group = 't.id';
- $criteriaWithHaving->having = 'test_field = 1';
+ $criteriaWithHaving->having = 'test_field = :test_field';
+ $criteriaWithHaving->params['test_field'] = 1;
$count = Post::model()->count($criteriaWithHaving);
$this->assertEquals(1, $count, 'Having condition has not been applied on count with relation!');
Please sign in to comment.
Something went wrong with that request. Please try again.