Commit 7e961eee by Carsten Brandt

fixed test break

parent 829850da
......@@ -41,4 +41,10 @@ class Exception extends \yii\base\Exception
{
return 'Database Exception';
}
public function __toString()
{
return parent::__toString() . PHP_EOL
. 'Additional Information:' . PHP_EOL . print_r($this->errorInfo, true);
}
}
......@@ -58,7 +58,6 @@ class Customer extends ActiveRecord
static::type() => [
"_id" => ["path" => "id", "index" => "not_analyzed", "store" => "yes"],
"properties" => [
"id" => ["type" => "integer"],
"name" => ["type" => "string", "index" => "not_analyzed"],
"email" => ["type" => "string", "index" => "not_analyzed"],
"address" => ["type" => "string", "index" => "analyzed"],
......
......@@ -3,6 +3,7 @@
namespace yiiunit\extensions\elasticsearch;
use yii\base\Event;
use yii\base\Exception;
use yii\db\BaseActiveRecord;
use yii\elasticsearch\Connection;
use yii\helpers\Json;
......@@ -344,8 +345,8 @@ class ActiveRecordTest extends ElasticSearchTestCase
public function testBooleanAttribute()
{
$db = $this->getConnection();
Customer::setUpMapping($db->createCommand(), true);
Customer::deleteAll();
Customer::setUpMapping($db->createCommand(), true);
$customerClass = $this->getCustomerClass();
$customer = new $customerClass();
......@@ -378,7 +379,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$this->assertEquals(2, count($customers));
}
public function testfindAsArrayFields()
public function testFindAsArrayFields()
{
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */
......@@ -402,7 +403,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$this->assertArrayNotHasKey('status', $customers[2]);
}
public function testfindIndexByFields()
public function testFindIndexByFields()
{
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */
......@@ -453,7 +454,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$this->assertNull($customers['3-user3']->status);
}
public function testfindIndexByAsArrayFields()
public function testFindIndexByAsArrayFields()
{
$customerClass = $this->getCustomerClass();
/** @var TestCase|ActiveRecordTestTrait $this */
......
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