Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
7e961eee
Commit
7e961eee
authored
Jan 16, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test break
parent
829850da
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
Exception.php
framework/db/Exception.php
+6
-0
Customer.php
tests/unit/data/ar/elasticsearch/Customer.php
+0
-1
ActiveRecordTest.php
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
+5
-4
No files found.
framework/db/Exception.php
View file @
7e961eee
...
...
@@ -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
);
}
}
tests/unit/data/ar/elasticsearch/Customer.php
View file @
7e961eee
...
...
@@ -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"
],
...
...
tests/unit/extensions/elasticsearch/ActiveRecordTest.php
View file @
7e961eee
...
...
@@ -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
test
f
indAsArrayFields
()
public
function
test
F
indAsArrayFields
()
{
$customerClass
=
$this
->
getCustomerClass
();
/** @var TestCase|ActiveRecordTestTrait $this */
...
...
@@ -402,7 +403,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$this
->
assertArrayNotHasKey
(
'status'
,
$customers
[
2
]);
}
public
function
test
f
indIndexByFields
()
public
function
test
F
indIndexByFields
()
{
$customerClass
=
$this
->
getCustomerClass
();
/** @var TestCase|ActiveRecordTestTrait $this */
...
...
@@ -453,7 +454,7 @@ class ActiveRecordTest extends ElasticSearchTestCase
$this
->
assertNull
(
$customers
[
'3-user3'
]
->
status
);
}
public
function
test
f
indIndexByAsArrayFields
()
public
function
test
F
indIndexByAsArrayFields
()
{
$customerClass
=
$this
->
getCustomerClass
();
/** @var TestCase|ActiveRecordTestTrait $this */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment