From ed97632f53e8fe5fbccf8ea4720ac951aa0d5c9e Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 17 Jan 2014 23:01:13 +0400 Subject: [PATCH] Fixed scope method signatures --- tests/unit/data/ar/CustomerQuery.php | 5 +++-- tests/unit/data/ar/mongodb/CustomerQuery.php | 5 +++-- tests/unit/data/ar/sphinx/ArticleIndexQuery.php | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/unit/data/ar/CustomerQuery.php b/tests/unit/data/ar/CustomerQuery.php index 89b9c9c93b..6b1013452b 100644 --- a/tests/unit/data/ar/CustomerQuery.php +++ b/tests/unit/data/ar/CustomerQuery.php @@ -7,9 +7,10 @@ use yii\db\ActiveQuery; */ class CustomerQuery extends ActiveQuery { - public static function active($query) + public function active() { - $query->andWhere('status=1'); + $this->andWhere('status=1'); + return $this; } } \ No newline at end of file diff --git a/tests/unit/data/ar/mongodb/CustomerQuery.php b/tests/unit/data/ar/mongodb/CustomerQuery.php index 009b7b2db8..bf222b6d3d 100644 --- a/tests/unit/data/ar/mongodb/CustomerQuery.php +++ b/tests/unit/data/ar/mongodb/CustomerQuery.php @@ -7,9 +7,10 @@ use yii\mongodb\ActiveQuery; */ class CustomerQuery extends ActiveQuery { - public static function activeOnly($query) + public function activeOnly() { - $query->andWhere(['status' => 2]); + $this->andWhere(['status' => 2]); + return $this; } } \ No newline at end of file diff --git a/tests/unit/data/ar/sphinx/ArticleIndexQuery.php b/tests/unit/data/ar/sphinx/ArticleIndexQuery.php index 19da67494b..f5843f001d 100644 --- a/tests/unit/data/ar/sphinx/ArticleIndexQuery.php +++ b/tests/unit/data/ar/sphinx/ArticleIndexQuery.php @@ -7,9 +7,10 @@ use yii\sphinx\ActiveQuery; */ class ArticleIndexQuery extends ActiveQuery { - public static function favoriteAuthor($query) + public function favoriteAuthor() { - $query->andWhere('author_id=1'); + $this->andWhere('author_id=1'); + return $this; } } \ No newline at end of file