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
c572c23c
Commit
c572c23c
authored
Apr 02, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted tests
parent
51eabf52
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
31 deletions
+31
-31
QueryTest.php
tests/unit/extensions/elasticsearch/QueryTest.php
+3
-3
QueryTest.php
tests/unit/extensions/mongodb/QueryTest.php
+3
-3
QueryTest.php
tests/unit/extensions/sphinx/QueryTest.php
+13
-13
QueryTest.php
tests/unit/framework/db/QueryTest.php
+12
-12
No files found.
tests/unit/extensions/elasticsearch/QueryTest.php
View file @
c572c23c
...
...
@@ -151,7 +151,7 @@ class QueryTest extends ElasticSearchTestCase
}
public
function
testFilter
()
public
function
testFilter
Where
()
{
// should work with hash format
$query
=
new
Query
;
...
...
@@ -162,10 +162,10 @@ class QueryTest extends ElasticSearchTestCase
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
andFilter
([
'status'
=>
null
]);
$query
->
andFilter
Where
([
'status'
=>
null
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
orFilter
([
'name'
=>
''
]);
$query
->
orFilter
Where
([
'name'
=>
''
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
}
...
...
tests/unit/extensions/mongodb/QueryTest.php
View file @
c572c23c
...
...
@@ -68,7 +68,7 @@ class QueryTest extends MongoDbTestCase
);
}
public
function
testFilter
()
public
function
testFilter
Where
()
{
// should work with hash format
$query
=
new
Query
;
...
...
@@ -79,10 +79,10 @@ class QueryTest extends MongoDbTestCase
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
andFilter
([
'status'
=>
null
]);
$query
->
andFilter
Where
([
'status'
=>
null
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
orFilter
([
'name'
=>
''
]);
$query
->
orFilter
Where
([
'name'
=>
''
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
}
...
...
tests/unit/extensions/sphinx/QueryTest.php
View file @
c572c23c
...
...
@@ -60,7 +60,7 @@ class QueryTest extends SphinxTestCase
$this
->
assertEquals
([
':id'
=>
1
,
':name'
=>
'something'
,
':age'
=>
'30'
],
$query
->
params
);
}
public
function
testFilter
()
public
function
testFilter
Where
()
{
// should just call where() when string is passed
$query
=
new
Query
;
...
...
@@ -77,10 +77,10 @@ class QueryTest extends SphinxTestCase
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
andFilter
([
'status'
=>
null
]);
$query
->
andFilter
Where
([
'status'
=>
null
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
orFilter
([
'name'
=>
''
]);
$query
->
orFilter
Where
([
'name'
=>
''
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
// should work with operator format
...
...
@@ -89,35 +89,35 @@ class QueryTest extends SphinxTestCase
$query
->
filterWhere
(
$condition
);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'between'
,
'id'
,
null
,
null
]);
$query
->
andFilter
Where
([
'between'
,
'id'
,
null
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
orFilter
([
'not between'
,
'id'
,
null
,
null
]);
$query
->
orFilter
Where
([
'not between'
,
'id'
,
null
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'not in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'not in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'like'
,
'id'
,
''
]);
$query
->
andFilter
Where
([
'like'
,
'id'
,
''
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'or like'
,
'id'
,
''
]);
$query
->
andFilter
Where
([
'or like'
,
'id'
,
''
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not like'
,
'id'
,
' '
]);
$query
->
andFilter
Where
([
'not like'
,
'id'
,
' '
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'or not like'
,
'id'
,
null
]);
$query
->
andFilter
Where
([
'or not like'
,
'id'
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
}
public
function
testFilterRecursively
()
public
function
testFilter
Where
Recursively
()
{
$query
=
new
Query
();
$query
->
filterWhere
([
'and'
,
[
'like'
,
'name'
,
''
],
[
'like'
,
'title'
,
''
],
[
'id'
=>
1
],
[
'not'
,
[
'like'
,
'name'
,
''
]]]);
...
...
tests/unit/framework/db/QueryTest.php
View file @
c572c23c
...
...
@@ -49,7 +49,7 @@ class QueryTest extends DatabaseTestCase
$this
->
assertEquals
([
':id'
=>
1
,
':name'
=>
'something'
,
':age'
=>
'30'
],
$query
->
params
);
}
public
function
testFilter
()
public
function
testFilter
Where
()
{
// should just call where() when string is passed
$query
=
new
Query
;
...
...
@@ -66,10 +66,10 @@ class QueryTest extends DatabaseTestCase
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
andFilter
([
'status'
=>
null
]);
$query
->
andFilter
Where
([
'status'
=>
null
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
$query
->
orFilter
([
'name'
=>
''
]);
$query
->
orFilter
Where
([
'name'
=>
''
]);
$this
->
assertEquals
([
'id'
=>
0
],
$query
->
where
);
// should work with operator format
...
...
@@ -78,31 +78,31 @@ class QueryTest extends DatabaseTestCase
$query
->
filterWhere
(
$condition
);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'between'
,
'id'
,
null
,
null
]);
$query
->
andFilter
Where
([
'between'
,
'id'
,
null
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
orFilter
([
'not between'
,
'id'
,
null
,
null
]);
$query
->
orFilter
Where
([
'not between'
,
'id'
,
null
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'not in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not in'
,
'id'
,
[]]);
$query
->
andFilter
Where
([
'not in'
,
'id'
,
[]]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'like'
,
'id'
,
''
]);
$query
->
andFilter
Where
([
'like'
,
'id'
,
''
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'or like'
,
'id'
,
''
]);
$query
->
andFilter
Where
([
'or like'
,
'id'
,
''
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'not like'
,
'id'
,
' '
]);
$query
->
andFilter
Where
([
'not like'
,
'id'
,
' '
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
$query
->
andFilter
([
'or not like'
,
'id'
,
null
]);
$query
->
andFilter
Where
([
'or not like'
,
'id'
,
null
]);
$this
->
assertEquals
(
$condition
,
$query
->
where
);
}
...
...
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