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
c73dbf29
Commit
c73dbf29
authored
Dec 05, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-112: Support typeMap option for findAndModify operations
parent
e7a5e3ca
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
142 additions
and
61 deletions
+142
-61
apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
...rgs-MongoDBCollection-method-findOneAndDelete-option.yaml
+6
-0
apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
...gs-MongoDBCollection-method-findOneAndReplace-option.yaml
+6
-0
apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
...rgs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+6
-0
extracts-bson-deserialization-base.yaml
docs/includes/extracts-bson-deserialization-base.yaml
+0
-12
extracts-bson-deserialization.yaml
docs/includes/extracts-bson-deserialization.yaml
+0
-21
MongoDBCollection-findOneAndDelete.txt
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
+2
-4
MongoDBCollection-findOneAndReplace.txt
.../reference/method/MongoDBCollection-findOneAndReplace.txt
+3
-4
MongoDBCollection-findOneAndUpdate.txt
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
+3
-4
Collection.php
src/Collection.php
+15
-12
FindAndModify.php
src/Operation/FindAndModify.php
+11
-1
FindOneAndDelete.php
src/Operation/FindOneAndDelete.php
+3
-1
FindOneAndReplace.php
src/Operation/FindOneAndReplace.php
+3
-1
FindOneAndUpdate.php
src/Operation/FindOneAndUpdate.php
+3
-1
FindAndModifyFunctionalTest.php
tests/Operation/FindAndModifyFunctionalTest.php
+77
-0
FindAndModifyTest.php
tests/Operation/FindAndModifyTest.php
+4
-0
No files found.
docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
View file @
c73dbf29
...
@@ -14,6 +14,12 @@ source:
...
@@ -14,6 +14,12 @@ source:
file
:
apiargs-common-option.yaml
file
:
apiargs-common-option.yaml
ref
:
maxTimeMS
ref
:
maxTimeMS
---
---
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
typeMap
post
:
|
This will be used for the returned result document.
---
source
:
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
writeConcern
ref
:
writeConcern
...
...
docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
View file @
c73dbf29
...
@@ -31,6 +31,12 @@ interface: phpmethod
...
@@ -31,6 +31,12 @@ interface: phpmethod
operation
:
~
operation
:
~
optional
:
true
optional
:
true
---
---
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
typeMap
post
:
|
This will be used for the returned result document.
---
source
:
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
upsert
ref
:
upsert
...
...
docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
View file @
c73dbf29
...
@@ -31,6 +31,12 @@ interface: phpmethod
...
@@ -31,6 +31,12 @@ interface: phpmethod
operation
:
~
operation
:
~
optional
:
true
optional
:
true
---
---
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
typeMap
post
:
|
This will be used for the returned result document.
---
source
:
source
:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
upsert
ref
:
upsert
...
...
docs/includes/extracts-bson-deserialization-base.yaml
deleted
100644 → 0
View file @
e7a5e3ca
ref
:
_bson-deserialization
content
:
|
.. note::
{{method}} does not yet support a ``typeMap`` option for BSON
deserialization of the returned document.
Classes implementing
:php:`MongoDB\\BSON\\Persistable <class.mongodb-bson-persistable>`
are deserialized according to the :php:`persistance
<mongodb.persistance>` specification.
...
docs/includes/extracts-bson-deserialization.yaml
deleted
100644 → 0
View file @
e7a5e3ca
ref
:
bson-deserialization-findOneAndDelete
source
:
file
:
extracts-bson-deserialization-base.yaml
ref
:
_bson-deserialization
replacement
:
method
:
"
:phpmethod:`MongoDB
\\
Collection::findOneAndDelete()`"
---
ref
:
bson-deserialization-findOneAndReplace
source
:
file
:
extracts-bson-deserialization-base.yaml
ref
:
_bson-deserialization
replacement
:
method
:
"
:phpmethod:`MongoDB
\\
Collection::findOneAndReplace()`"
---
ref
:
bson-deserialization-findOneAndUpdate
source
:
file
:
extracts-bson-deserialization-base.yaml
ref
:
_bson-deserialization
replacement
:
method
:
"
:phpmethod:`MongoDB
\\
Collection::findOneAndUpdate()`"
...
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
View file @
c73dbf29
...
@@ -29,13 +29,11 @@ Definition
...
@@ -29,13 +29,11 @@ Definition
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndDelete-option.rst
.. include:: /includes/extracts/bson-deserialization-findOneAndDelete.rst
Return Values
Return Values
-------------
-------------
An
object for the document that was deleted, or ``null`` if no document matched
An
array or object for the document that was deleted, or ``null`` if no document
the query
.
matched the query. The return type will depend on the ``typeMap`` option
.
Errors/Exceptions
Errors/Exceptions
-----------------
-----------------
...
...
docs/reference/method/MongoDBCollection-findOneAndReplace.txt
View file @
c73dbf29
...
@@ -29,14 +29,13 @@ Definition
...
@@ -29,14 +29,13 @@ Definition
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndReplace-option.rst
.. include:: /includes/extracts/bson-deserialization-findOneAndReplace.rst
Return Values
Return Values
-------------
-------------
An
object for either the original or the replaced document, depending on the
An
array object for either the original or the replaced document, depending on
specified value of the ``returnDocument`` option. By default, the original
the
specified value of the ``returnDocument`` option. By default, the original
document is returned. If no document matched the query, ``null`` is returned.
document is returned. If no document matched the query, ``null`` is returned.
The return type will depend on the ``typeMap`` option.
Errors/Exceptions
Errors/Exceptions
-----------------
-----------------
...
...
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
View file @
c73dbf29
...
@@ -29,14 +29,13 @@ Definition
...
@@ -29,14 +29,13 @@ Definition
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
.. include:: /includes/apiargs/MongoDBCollection-method-findOneAndUpdate-option.rst
.. include:: /includes/extracts/bson-deserialization-findOneAndUpdate.rst
Return Values
Return Values
-------------
-------------
An
object for either the original or the updated document, depending on the
An
array or object for either the original or the updated document, depending on
specified value of the ``returnDocument`` option. By default, the original
the
specified value of the ``returnDocument`` option. By default, the original
document is returned. If no document matched the query, ``null`` is returned.
document is returned. If no document matched the query, ``null`` is returned.
The return type will depend on the ``typeMap`` option.
Errors/Exceptions
Errors/Exceptions
-----------------
-----------------
...
...
src/Collection.php
View file @
c73dbf29
...
@@ -553,14 +553,11 @@ class Collection
...
@@ -553,14 +553,11 @@ class Collection
*
*
* The document to return may be null if no document matched the filter.
* The document to return may be null if no document matched the filter.
*
*
* Note: BSON deserialization of the returned document does not yet support
* a custom type map (depends on: https://jira.mongodb.org/browse/PHPC-314).
*
* @see FindOneAndDelete::__construct() for supported options
* @see FindOneAndDelete::__construct() for supported options
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @param array|object $filter Query by which to filter documents
* @param array|object $filter Query by which to filter documents
* @param array $options Command options
* @param array $options Command options
* @return object|null
* @return
array|
object|null
* @throws UnexpectedValueException if the command response was malformed
* @throws UnexpectedValueException if the command response was malformed
* @throws UnsupportedException if options are not supported by the selected server
* @throws UnsupportedException if options are not supported by the selected server
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws InvalidArgumentException for parameter/option parsing errors
...
@@ -574,6 +571,10 @@ class Collection
...
@@ -574,6 +571,10 @@ class Collection
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
}
}
if
(
!
isset
(
$options
[
'typeMap'
]))
{
$options
[
'typeMap'
]
=
$this
->
typeMap
;
}
$operation
=
new
FindOneAndDelete
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$options
);
$operation
=
new
FindOneAndDelete
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$options
);
return
$operation
->
execute
(
$server
);
return
$operation
->
execute
(
$server
);
...
@@ -588,15 +589,12 @@ class Collection
...
@@ -588,15 +589,12 @@ class Collection
* FindOneAndReplace::RETURN_DOCUMENT_AFTER for the "returnDocument" option
* FindOneAndReplace::RETURN_DOCUMENT_AFTER for the "returnDocument" option
* to return the updated document.
* to return the updated document.
*
*
* Note: BSON deserialization of the returned document does not yet support
* a custom type map (depends on: https://jira.mongodb.org/browse/PHPC-314).
*
* @see FindOneAndReplace::__construct() for supported options
* @see FindOneAndReplace::__construct() for supported options
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @param array|object $filter Query by which to filter documents
* @param array|object $filter Query by which to filter documents
* @param array|object $replacement Replacement document
* @param array|object $replacement Replacement document
* @param array $options Command options
* @param array $options Command options
* @return object|null
* @return
array|
object|null
* @throws UnexpectedValueException if the command response was malformed
* @throws UnexpectedValueException if the command response was malformed
* @throws UnsupportedException if options are not supported by the selected server
* @throws UnsupportedException if options are not supported by the selected server
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws InvalidArgumentException for parameter/option parsing errors
...
@@ -610,6 +608,10 @@ class Collection
...
@@ -610,6 +608,10 @@ class Collection
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
}
}
if
(
!
isset
(
$options
[
'typeMap'
]))
{
$options
[
'typeMap'
]
=
$this
->
typeMap
;
}
$operation
=
new
FindOneAndReplace
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$replacement
,
$options
);
$operation
=
new
FindOneAndReplace
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$replacement
,
$options
);
return
$operation
->
execute
(
$server
);
return
$operation
->
execute
(
$server
);
...
@@ -624,15 +626,12 @@ class Collection
...
@@ -624,15 +626,12 @@ class Collection
* FindOneAndUpdate::RETURN_DOCUMENT_AFTER for the "returnDocument" option
* FindOneAndUpdate::RETURN_DOCUMENT_AFTER for the "returnDocument" option
* to return the updated document.
* to return the updated document.
*
*
* Note: BSON deserialization of the returned document does not yet support
* a custom type map (depends on: https://jira.mongodb.org/browse/PHPC-314).
*
* @see FindOneAndReplace::__construct() for supported options
* @see FindOneAndReplace::__construct() for supported options
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @see http://docs.mongodb.org/manual/reference/command/findAndModify/
* @param array|object $filter Query by which to filter documents
* @param array|object $filter Query by which to filter documents
* @param array|object $update Update to apply to the matched document
* @param array|object $update Update to apply to the matched document
* @param array $options Command options
* @param array $options Command options
* @return object|null
* @return
array|
object|null
* @throws UnexpectedValueException if the command response was malformed
* @throws UnexpectedValueException if the command response was malformed
* @throws UnsupportedException if options are not supported by the selected server
* @throws UnsupportedException if options are not supported by the selected server
* @throws InvalidArgumentException for parameter/option parsing errors
* @throws InvalidArgumentException for parameter/option parsing errors
...
@@ -646,6 +645,10 @@ class Collection
...
@@ -646,6 +645,10 @@ class Collection
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
$options
[
'writeConcern'
]
=
$this
->
writeConcern
;
}
}
if
(
!
isset
(
$options
[
'typeMap'
]))
{
$options
[
'typeMap'
]
=
$this
->
typeMap
;
}
$operation
=
new
FindOneAndUpdate
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$update
,
$options
);
$operation
=
new
FindOneAndUpdate
(
$this
->
databaseName
,
$this
->
collectionName
,
$filter
,
$update
,
$options
);
return
$operation
->
execute
(
$server
);
return
$operation
->
execute
(
$server
);
...
...
src/Operation/FindAndModify.php
View file @
c73dbf29
...
@@ -60,6 +60,8 @@ class FindAndModify implements Executable
...
@@ -60,6 +60,8 @@ class FindAndModify implements Executable
* * sort (document): Determines which document the operation modifies if
* * sort (document): Determines which document the operation modifies if
* the query selects multiple documents.
* the query selects multiple documents.
*
*
* * typeMap (array): Type map for BSON deserialization.
*
* * update (document): Update or replacement to apply to the matched
* * update (document): Update or replacement to apply to the matched
* document. This option cannot be set if the remove option is true.
* document. This option cannot be set if the remove option is true.
*
*
...
@@ -117,6 +119,10 @@ class FindAndModify implements Executable
...
@@ -117,6 +119,10 @@ class FindAndModify implements Executable
throw
InvalidArgumentException
::
invalidType
(
'"sort" option'
,
$options
[
'sort'
],
'array or object'
);
throw
InvalidArgumentException
::
invalidType
(
'"sort" option'
,
$options
[
'sort'
],
'array or object'
);
}
}
if
(
isset
(
$options
[
'typeMap'
])
&&
!
is_array
(
$options
[
'typeMap'
]))
{
throw
InvalidArgumentException
::
invalidType
(
'"typeMap" option'
,
$options
[
'typeMap'
],
'array'
);
}
if
(
isset
(
$options
[
'update'
])
&&
!
is_array
(
$options
[
'update'
])
&&
!
is_object
(
$options
[
'update'
]))
{
if
(
isset
(
$options
[
'update'
])
&&
!
is_array
(
$options
[
'update'
])
&&
!
is_object
(
$options
[
'update'
]))
{
throw
InvalidArgumentException
::
invalidType
(
'"update" option'
,
$options
[
'update'
],
'array or object'
);
throw
InvalidArgumentException
::
invalidType
(
'"update" option'
,
$options
[
'update'
],
'array or object'
);
}
}
...
@@ -143,7 +149,7 @@ class FindAndModify implements Executable
...
@@ -143,7 +149,7 @@ class FindAndModify implements Executable
*
*
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return
array|
object|null
* @throws UnexpectedValueException if the command response was malformed
* @throws UnexpectedValueException if the command response was malformed
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
...
@@ -180,6 +186,10 @@ class FindAndModify implements Executable
...
@@ -180,6 +186,10 @@ class FindAndModify implements Executable
throw
new
UnexpectedValueException
(
'findAndModify command did not return a "value" document'
);
throw
new
UnexpectedValueException
(
'findAndModify command did not return a "value" document'
);
}
}
if
(
isset
(
$this
->
options
[
'typeMap'
]))
{
return
\MongoDB\apply_type_map_to_document
(
$result
->
value
,
$this
->
options
[
'typeMap'
]);
}
return
$result
->
value
;
return
$result
->
value
;
}
}
...
...
src/Operation/FindOneAndDelete.php
View file @
c73dbf29
...
@@ -37,6 +37,8 @@ class FindOneAndDelete implements Executable
...
@@ -37,6 +37,8 @@ class FindOneAndDelete implements Executable
* * sort (document): Determines which document the operation modifies if
* * sort (document): Determines which document the operation modifies if
* the query selects multiple documents.
* the query selects multiple documents.
*
*
* * typeMap (array): Type map for BSON deserialization.
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
*
*
* This is not supported for server versions < 3.2 and will result in an
* This is not supported for server versions < 3.2 and will result in an
...
@@ -76,7 +78,7 @@ class FindOneAndDelete implements Executable
...
@@ -76,7 +78,7 @@ class FindOneAndDelete implements Executable
*
*
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return
array|
object|null
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
...
...
src/Operation/FindOneAndReplace.php
View file @
c73dbf29
...
@@ -49,6 +49,8 @@ class FindOneAndReplace implements Executable
...
@@ -49,6 +49,8 @@ class FindOneAndReplace implements Executable
* * sort (document): Determines which document the operation modifies if
* * sort (document): Determines which document the operation modifies if
* the query selects multiple documents.
* the query selects multiple documents.
*
*
* * typeMap (array): Type map for BSON deserialization.
*
* * upsert (boolean): When true, a new document is created if no document
* * upsert (boolean): When true, a new document is created if no document
* matches the query. The default is false.
* matches the query. The default is false.
*
*
...
@@ -116,7 +118,7 @@ class FindOneAndReplace implements Executable
...
@@ -116,7 +118,7 @@ class FindOneAndReplace implements Executable
*
*
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return
array|
object|null
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
...
...
src/Operation/FindOneAndUpdate.php
View file @
c73dbf29
...
@@ -49,6 +49,8 @@ class FindOneAndUpdate implements Executable
...
@@ -49,6 +49,8 @@ class FindOneAndUpdate implements Executable
* * sort (document): Determines which document the operation modifies if
* * sort (document): Determines which document the operation modifies if
* the query selects multiple documents.
* the query selects multiple documents.
*
*
* * typeMap (array): Type map for BSON deserialization.
*
* * upsert (boolean): When true, a new document is created if no document
* * upsert (boolean): When true, a new document is created if no document
* matches the query. The default is false.
* matches the query. The default is false.
*
*
...
@@ -116,7 +118,7 @@ class FindOneAndUpdate implements Executable
...
@@ -116,7 +118,7 @@ class FindOneAndUpdate implements Executable
*
*
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return
array|
object|null
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws UnsupportedException if collation or write concern is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
...
...
tests/Operation/FindAndModifyFunctionalTest.php
0 → 100644
View file @
c73dbf29
<?php
namespace
MongoDB\Tests\Operation
;
use
MongoDB\Driver\BulkWrite
;
use
MongoDB\Model\BSONDocument
;
use
MongoDB\Operation\FindAndModify
;
class
FindAndModifyFunctionalTest
extends
FunctionalTestCase
{
/**
* @dataProvider provideTypeMapOptionsAndExpectedDocument
*/
public
function
testTypeMapOption
(
array
$typeMap
=
null
,
$expectedDocument
)
{
$this
->
createFixtures
(
1
);
$operation
=
new
FindAndModify
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[
'remove'
=>
true
,
'typeMap'
=>
$typeMap
,
]
);
$document
=
$operation
->
execute
(
$this
->
getPrimaryServer
());
$this
->
assertEquals
(
$expectedDocument
,
$document
);
}
public
function
provideTypeMapOptionsAndExpectedDocument
()
{
return
[
[
null
,
(
object
)
[
'_id'
=>
1
,
'x'
=>
(
object
)
[
'foo'
=>
'bar'
]],
],
[
[
'root'
=>
'array'
,
'document'
=>
'array'
],
[
'_id'
=>
1
,
'x'
=>
[
'foo'
=>
'bar'
]],
],
[
[
'root'
=>
'object'
,
'document'
=>
'array'
],
(
object
)
[
'_id'
=>
1
,
'x'
=>
[
'foo'
=>
'bar'
]],
],
[
[
'root'
=>
'array'
,
'document'
=>
'stdClass'
],
[
'_id'
=>
1
,
'x'
=>
(
object
)
[
'foo'
=>
'bar'
]],
],
[
[
'root'
=>
'MongoDB\Model\BSONDocument'
,
'document'
=>
'object'
],
new
BSONDocument
([
'_id'
=>
1
,
'x'
=>
(
object
)
[
'foo'
=>
'bar'
]]),
],
];
}
/**
* Create data fixtures.
*
* @param integer $n
*/
private
function
createFixtures
(
$n
)
{
$bulkWrite
=
new
BulkWrite
([
'ordered'
=>
true
]);
for
(
$i
=
1
;
$i
<=
$n
;
$i
++
)
{
$bulkWrite
->
insert
([
'_id'
=>
$i
,
'x'
=>
(
object
)
[
'foo'
=>
'bar'
],
]);
}
$result
=
$this
->
manager
->
executeBulkWrite
(
$this
->
getNamespace
(),
$bulkWrite
);
$this
->
assertEquals
(
$n
,
$result
->
getInsertedCount
());
}
}
tests/Operation/FindAndModifyTest.php
View file @
c73dbf29
...
@@ -51,6 +51,10 @@ class FindAndModifyTest extends TestCase
...
@@ -51,6 +51,10 @@ class FindAndModifyTest extends TestCase
$options
[][]
=
[
'sort'
=>
$value
];
$options
[][]
=
[
'sort'
=>
$value
];
}
}
foreach
(
$this
->
getInvalidArrayValues
()
as
$value
)
{
$options
[][]
=
[
'typeMap'
=>
$value
];
}
foreach
(
$this
->
getInvalidDocumentValues
()
as
$value
)
{
foreach
(
$this
->
getInvalidDocumentValues
()
as
$value
)
{
$options
[][]
=
[
'update'
=>
$value
];
$options
[][]
=
[
'update'
=>
$value
];
}
}
...
...
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