Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
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
sinan
laravel-mongodb
Commits
d0822e74
Commit
d0822e74
authored
Aug 09, 2014
by
Jens Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding some complicated test queries
parent
3058f37a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
26 deletions
+51
-26
QueryTest.php
tests/QueryTest.php
+51
-26
No files found.
tests/QueryTest.php
View file @
d0822e74
...
@@ -239,6 +239,31 @@ class QueryTest extends TestCase {
...
@@ -239,6 +239,31 @@ class QueryTest extends TestCase {
->
get
();
->
get
();
$this
->
assertEquals
(
5
,
count
(
$users
));
$this
->
assertEquals
(
5
,
count
(
$users
));
$users
=
User
::
whereNull
(
'deleted_at'
)
->
where
(
'title'
,
'admin'
)
->
where
(
function
(
$query
)
{
$query
->
where
(
'age'
,
'>'
,
15
)
->
orWhere
(
'name'
,
'Harry Hoe'
);
})
->
get
();
$this
->
assertEquals
(
3
,
$users
->
count
());
$users
=
User
::
whereNull
(
'deleted_at'
)
->
where
(
function
(
$query
)
{
$query
->
where
(
'name'
,
'Harry Hoe'
)
->
orWhere
(
function
(
$query
)
{
$query
->
where
(
'age'
,
'>'
,
15
)
->
where
(
'title'
,
'<>'
,
'admin'
);
});
})
->
get
();
$this
->
assertEquals
(
5
,
$users
->
count
());
}
}
public
function
testWhereRaw
()
public
function
testWhereRaw
()
...
...
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