From b868e91feeea7a8bc9748b487b3aaadc0acf8257 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 3 Dec 2013 23:52:21 -0500 Subject: [PATCH] Fixed test break. --- tests/unit/framework/ar/ActiveRecordTestTrait.php | 4 ---- tests/unit/framework/db/ActiveRecordTest.php | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/framework/ar/ActiveRecordTestTrait.php b/tests/unit/framework/ar/ActiveRecordTestTrait.php index bf1e09a..44bcf4d 100644 --- a/tests/unit/framework/ar/ActiveRecordTestTrait.php +++ b/tests/unit/framework/ar/ActiveRecordTestTrait.php @@ -411,10 +411,6 @@ trait ActiveRecordTestTrait $this->assertTrue($customer->isRelationPopulated('orders')); $this->assertEquals(1, count($customer->orders)); $this->assertEquals(1, count($customer->populatedRelations)); - - // https://github.com/yiisoft/yii2/issues/1402 - $orders = $this->callOrderFind()->with('books')->asArray()->all(); - $this->assertEquals(3, count($orders)); } public function testFindLazyVia() diff --git a/tests/unit/framework/db/ActiveRecordTest.php b/tests/unit/framework/db/ActiveRecordTest.php index 67d107a..bce6d94 100644 --- a/tests/unit/framework/db/ActiveRecordTest.php +++ b/tests/unit/framework/db/ActiveRecordTest.php @@ -105,6 +105,10 @@ class ActiveRecordTest extends DatabaseTestCase $orders = Order::find()->with('books')->orderBy('id')->all(); $this->assertEquals(3, count($orders)); + // https://github.com/yiisoft/yii2/issues/1402 + $orders = Order::find()->with('books')->orderBy('id')->asArray()->all(); + $this->assertEquals(3, count($orders)); + $order = $orders[0]; $this->assertEquals(1, $order->id); $this->assertEquals(2, count($order->books));