Commit 9c564808 by Alexander Makarov

Added missing models for Redis tests

parent 092ca93a
<?php
namespace yiiunit\data\ar\redis;
/**
* Class OrderItem
*
* @property integer $order_id
* @property integer $item_id
* @property integer $quantity
* @property string $subtotal
*/
class OrderItemWithNullFK extends ActiveRecord
{
public static function primaryKey()
{
return ['order_id', 'item_id'];
}
public function attributes()
{
return ['order_id', 'item_id', 'quantity', 'subtotal'];
}
}
<?php
namespace yiiunit\data\ar\redis;
/**
* Class Order
*
* @property integer $id
* @property integer $customer_id
* @property integer $created_at
* @property string $total
*/
class OrderWithNullFK extends ActiveRecord
{
public static function primaryKey()
{
return ['id'];
}
public function attributes()
{
return ['id', 'customer_id', 'created_at', 'total'];
}
}
......@@ -8,6 +8,8 @@ use yiiunit\data\ar\redis\Customer;
use yiiunit\data\ar\redis\OrderItem;
use yiiunit\data\ar\redis\Order;
use yiiunit\data\ar\redis\Item;
use yiiunit\data\ar\redis\OrderItemWithNullFK;
use yiiunit\data\ar\redis\OrderWithNullFK;
use yiiunit\framework\ar\ActiveRecordTestTrait;
/**
......@@ -37,6 +39,16 @@ class ActiveRecordTest extends RedisTestCase
return OrderItem::className();
}
public function getOrderWithNullFKClass()
{
return OrderWithNullFK::className();
}
public function getOrderItemWithNullFKmClass()
{
return OrderItemWithNullFK::className();
}
public function setUp()
{
parent::setUp();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment