Browse Source

Fixed test break.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
b868e91fee
  1. 4
      tests/unit/framework/ar/ActiveRecordTestTrait.php
  2. 4
      tests/unit/framework/db/ActiveRecordTest.php

4
tests/unit/framework/ar/ActiveRecordTestTrait.php

@ -411,10 +411,6 @@ trait ActiveRecordTestTrait
$this->assertTrue($customer->isRelationPopulated('orders')); $this->assertTrue($customer->isRelationPopulated('orders'));
$this->assertEquals(1, count($customer->orders)); $this->assertEquals(1, count($customer->orders));
$this->assertEquals(1, count($customer->populatedRelations)); $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() public function testFindLazyVia()

4
tests/unit/framework/db/ActiveRecordTest.php

@ -105,6 +105,10 @@ class ActiveRecordTest extends DatabaseTestCase
$orders = Order::find()->with('books')->orderBy('id')->all(); $orders = Order::find()->with('books')->orderBy('id')->all();
$this->assertEquals(3, count($orders)); $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]; $order = $orders[0];
$this->assertEquals(1, $order->id); $this->assertEquals(1, $order->id);
$this->assertEquals(2, count($order->books)); $this->assertEquals(2, count($order->books));

Loading…
Cancel
Save