Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
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
mongo-php-library
Commits
76ef2717
Commit
76ef2717
authored
Feb 01, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #470
parents
7231d874
a46f70bf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
MapReduce.php
src/Operation/MapReduce.php
+1
-5
CollectionFunctionalTest.php
tests/Collection/CollectionFunctionalTest.php
+0
-1
MapReduceFunctionalTest.php
tests/Operation/MapReduceFunctionalTest.php
+16
-0
No files found.
src/Operation/MapReduce.php
View file @
76ef2717
...
...
@@ -121,7 +121,7 @@ class MapReduce implements Executable
* applied to the returned Cursor (it is not sent to the server).
*
* * verbose (boolean): Specifies whether to include the timing information
* in the result information.
The default is true.
* in the result information.
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This only
* applies when results are output to a collection.
...
...
@@ -143,10 +143,6 @@ class MapReduce implements Executable
throw
InvalidArgumentException
::
invalidType
(
'$out'
,
$out
,
'string or array or object'
);
}
$options
+=
[
'verbose'
=>
true
,
];
if
(
isset
(
$options
[
'bypassDocumentValidation'
])
&&
!
is_bool
(
$options
[
'bypassDocumentValidation'
]))
{
throw
InvalidArgumentException
::
invalidType
(
'"bypassDocumentValidation" option'
,
$options
[
'bypassDocumentValidation'
],
'boolean'
);
}
...
...
tests/Collection/CollectionFunctionalTest.php
View file @
76ef2717
...
...
@@ -201,7 +201,6 @@ class CollectionFunctionalTest extends FunctionalTestCase
$this
->
assertGreaterThanOrEqual
(
0
,
$result
->
getExecutionTimeMS
());
$this
->
assertNotEmpty
(
$result
->
getCounts
());
$this
->
assertNotEmpty
(
$result
->
getTiming
());
}
/**
...
...
tests/Operation/MapReduceFunctionalTest.php
View file @
76ef2717
...
...
@@ -90,6 +90,22 @@ class MapReduceFunctionalTest extends FunctionalTestCase
$operation
=
new
MapReduce
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$map
,
$reduce
,
$out
);
$result
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
assertInstanceOf
(
'MongoDB\MapReduceResult'
,
$result
);
$this
->
assertGreaterThanOrEqual
(
0
,
$result
->
getExecutionTimeMS
());
$this
->
assertNotEmpty
(
$result
->
getCounts
());
}
public
function
testResultIncludesTimingWithVerboseOption
()
{
$this
->
createFixtures
(
3
);
$map
=
new
Javascript
(
'function() { emit(this.x, this.y); }'
);
$reduce
=
new
Javascript
(
'function(key, values) { return Array.sum(values); }'
);
$out
=
[
'inline'
=>
1
];
$operation
=
new
MapReduce
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
$map
,
$reduce
,
$out
,
[
'verbose'
=>
true
]);
$result
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
assertInstanceOf
(
'MongoDB\MapReduceResult'
,
$result
);
$this
->
assertGreaterThanOrEqual
(
0
,
$result
->
getExecutionTimeMS
());
$this
->
assertNotEmpty
(
$result
->
getCounts
());
...
...
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