|
|
@ -47,6 +47,7 @@ class ActiveRecordTest extends ElasticSearchTestCase |
|
|
|
if ($db->createCommand()->indexExists('yiitest')) { |
|
|
|
if ($db->createCommand()->indexExists('yiitest')) { |
|
|
|
$db->createCommand()->deleteIndex('yiitest'); |
|
|
|
$db->createCommand()->deleteIndex('yiitest'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$db->createCommand()->createIndex('yiitest'); |
|
|
|
|
|
|
|
|
|
|
|
$command = $db->createCommand(); |
|
|
|
$command = $db->createCommand(); |
|
|
|
Customer::setUpMapping($command); |
|
|
|
Customer::setUpMapping($command); |
|
|
@ -54,6 +55,8 @@ class ActiveRecordTest extends ElasticSearchTestCase |
|
|
|
Order::setUpMapping($command); |
|
|
|
Order::setUpMapping($command); |
|
|
|
OrderItem::setUpMapping($command); |
|
|
|
OrderItem::setUpMapping($command); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->createCommand()->flushIndex('yiitest'); |
|
|
|
|
|
|
|
|
|
|
|
$customer = new Customer(); |
|
|
|
$customer = new Customer(); |
|
|
|
$customer->id = 1; |
|
|
|
$customer->id = 1; |
|
|
|
$customer->setAttributes(['email' => 'user1@example.com', 'name' => 'user1', 'address' => 'address1', 'status' => 1], false); |
|
|
|
$customer->setAttributes(['email' => 'user1@example.com', 'name' => 'user1', 'address' => 'address1', 'status' => 1], false); |
|
|
|