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
44e59fed
Commit
44e59fed
authored
Sep 14, 2017
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-280: Rename ObjectID to ObjectId
parent
dcb4ccaa
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
57 additions
and
57 deletions
+57
-57
apiargs-MongoDBGridFSBucket-common-option.yaml
docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
+1
-1
extracts-note.yaml
docs/includes/extracts-note.yaml
+1
-1
bson.txt
docs/reference/bson.txt
+2
-2
MongoDBBulkWriteResult-getInsertedIds.txt
...eference/method/MongoDBBulkWriteResult-getInsertedIds.txt
+1
-1
MongoDBBulkWriteResult-getUpsertedIds.txt
...eference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
+1
-1
MongoDBCollection-find.txt
docs/reference/method/MongoDBCollection-find.txt
+5
-5
MongoDBCollection-findOne.txt
docs/reference/method/MongoDBCollection-findOne.txt
+4
-4
MongoDBCollection-findOneAndDelete.txt
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
+1
-1
MongoDBCollection-findOneAndReplace.txt
.../reference/method/MongoDBCollection-findOneAndReplace.txt
+1
-1
MongoDBCollection-findOneAndUpdate.txt
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
+1
-1
MongoDBCollection-insertMany.txt
docs/reference/method/MongoDBCollection-insertMany.txt
+2
-2
MongoDBCollection-insertOne.txt
docs/reference/method/MongoDBCollection-insertOne.txt
+1
-1
MongoDBGridFSBucket-uploadFromStream.txt
...reference/method/MongoDBGridFSBucket-uploadFromStream.txt
+1
-1
MongoDBInsertManyResult-getInsertedIds.txt
...ference/method/MongoDBInsertManyResult-getInsertedIds.txt
+1
-1
MongoDBInsertOneResult-getInsertedId.txt
...reference/method/MongoDBInsertOneResult-getInsertedId.txt
+1
-1
MongoDBUpdateResult-getUpsertedId.txt
docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt
+1
-1
commands.txt
docs/tutorial/commands.txt
+3
-3
crud.txt
docs/tutorial/crud.txt
+6
-6
BulkWriteResult.php
src/BulkWriteResult.php
+2
-2
InsertManyResult.php
src/InsertManyResult.php
+1
-1
InsertOneResult.php
src/InsertOneResult.php
+1
-1
UpdateResult.php
src/UpdateResult.php
+1
-1
DocumentationExamplesTest.php
tests/DocumentationExamplesTest.php
+9
-9
FunctionalTestCase.php
tests/FunctionalTestCase.php
+4
-4
BucketFunctionalTest.php
tests/GridFS/BucketFunctionalTest.php
+2
-2
SpecFunctionalTest.php
tests/GridFS/SpecFunctionalTest.php
+1
-1
MapReduceTest.php
tests/Operation/MapReduceTest.php
+2
-2
No files found.
docs/includes/apiargs-MongoDBGridFSBucket-common-option.yaml
View file @
44e59fed
...
...
@@ -3,7 +3,7 @@ name: _id
type
:
mixed
description
:
|
Value to use as the file document identifier. Defaults to a new
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object.
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object.
interface
:
phpmethod
operation
:
~
optional
:
true
...
...
docs/includes/extracts-note.yaml
View file @
44e59fed
...
...
@@ -7,6 +7,6 @@ content: |
<manual/en/language.types.type-juggling.php>` rules. When matching a special
BSON type the query criteria should use the respective :php:`BSON class
<manual/en/book.bson.php>` in the driver (e.g. use
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` to match an
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` to match an
:manual:`ObjectId </reference/object-id/>`).
...
docs/reference/bson.txt
View file @
44e59fed
...
...
@@ -124,7 +124,7 @@ Consider the following class definition:
public function __construct($name)
{
$this->id = new MongoDB\BSON\ObjectI
D
;
$this->id = new MongoDB\BSON\ObjectI
d
;
$this->name = (string) $name;
$this->createdAt = new MongoDB\BSON\UTCDateTime;
}
...
...
@@ -167,7 +167,7 @@ The output would then resemble:
object(Person)#18 (3) {
["id":"Person":private]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
string(24) "56fad2c36118fd2e9820cfc1"
}
...
...
docs/reference/method/MongoDBBulkWriteResult-getInsertedIds.txt
View file @
44e59fed
...
...
@@ -34,5 +34,5 @@ insert operations in the bulk write.
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
not generate an ID), the index will contain its ``_id`` field value. Any
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
docs/reference/method/MongoDBBulkWriteResult-getUpsertedIds.txt
View file @
44e59fed
...
...
@@ -31,7 +31,7 @@ update and replace operations in the bulk write.
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to upserting (i.e. the server did
not generate an ID), the index will contain its ``_id`` field value. Any
server-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
server-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
Errors/Exceptions
...
...
docs/reference/method/MongoDBCollection-find.txt
View file @
44e59fed
...
...
@@ -83,7 +83,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
}
...
...
@@ -99,7 +99,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f98d"
}
...
...
@@ -115,7 +115,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#10 (1) {
object(MongoDB\BSON\ObjectI
d
)#10 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f99b"
}
...
...
@@ -131,7 +131,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#13 (1) {
object(MongoDB\BSON\ObjectI
d
)#13 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f9a8"
}
...
...
@@ -147,7 +147,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f9b4"
}
...
...
docs/reference/method/MongoDBCollection-findOne.txt
View file @
44e59fed
...
...
@@ -56,9 +56,9 @@ Matching BSON Types in Query Criteria
In the following example, documents in the ``restaurants`` collection use an
:manual:`ObjectId </reference/object-id/>` for their identifier (the default)
and documents in the ``zips`` collection use a string. Since ObjectI
D
is a
and documents in the ``zips`` collection use a string. Since ObjectI
d
is a
special BSON type, the query criteria for selecting a restaurant must use the
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` class.
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` class.
.. code-block:: php
...
...
@@ -67,7 +67,7 @@ special BSON type, the query criteria for selecting a restaurant must use the
$zip = $database->zips->findOne(['_id' => '10036']);
$restaurant = $database->restaurants->findOne([
'_id' => new MongoDB\BSON\ObjectI
D
('594d5ef280a846852a4b3f70'),
'_id' => new MongoDB\BSON\ObjectI
d
('594d5ef280a846852a4b3f70'),
]);
Projecting Fields
...
...
@@ -104,7 +104,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
}
...
...
docs/reference/method/MongoDBCollection-findOneAndDelete.txt
View file @
44e59fed
...
...
@@ -79,7 +79,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
string(24) "594d5ef280a846852a4b3f70"
}
...
...
docs/reference/method/MongoDBCollection-findOneAndReplace.txt
View file @
44e59fed
...
...
@@ -121,7 +121,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(6) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
string(24) "594d5ef380a846852a4b5837"
}
...
...
docs/reference/method/MongoDBCollection-findOneAndUpdate.txt
View file @
44e59fed
...
...
@@ -80,7 +80,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(2) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
string(24) "594d5ef280a846852a4b3dee"
}
...
...
docs/reference/method/MongoDBCollection-insertMany.txt
View file @
44e59fed
...
...
@@ -84,12 +84,12 @@ The output would then resemble::
Inserted 2 document(s)
array(2) {
[0]=>
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
string(24) "579a25921f417dd1e5518141"
}
[1]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
string(24) "579a25921f417dd1e5518142"
}
...
...
docs/reference/method/MongoDBCollection-insertOne.txt
View file @
44e59fed
...
...
@@ -74,7 +74,7 @@ The following operation inserts a document into the ``users`` collection in the
The output would then resemble::
Inserted 1 document(s)
object(MongoDB\BSON\ObjectI
D
)#11 (1) {
object(MongoDB\BSON\ObjectI
d
)#11 (1) {
["oid"]=>
string(24) "579a25921f417dd1e5518141"
}
...
...
docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt
View file @
44e59fed
...
...
@@ -34,7 +34,7 @@ Return Values
The ``_id`` field of the metadata document associated with the newly created
GridFS file. If the ``_id`` option is not specified, a new
:php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object will be used
:php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object will be used
by default.
Errors/Exceptions
...
...
docs/reference/method/MongoDBInsertManyResult-getInsertedIds.txt
View file @
44e59fed
...
...
@@ -32,5 +32,5 @@ A map of IDs (i.e. ``_id`` field values) for the inserted documents.
The index of each ID in the map corresponds to each document's position in the
bulk operation. If a document had an ID prior to inserting (i.e. the driver did
not generate an ID), the index will contain its ``_id`` field value. Any
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
D
driver-generated ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` instance.
docs/reference/method/MongoDBInsertOneResult-getInsertedId.txt
View file @
44e59fed
...
...
@@ -31,5 +31,5 @@ The ID (i.e. ``_id`` field value) of the inserted document.
If the document had an ID prior to inserting (i.e. the driver did not need to
generate an ID), this will contain its ``_id`` field value. Any driver-generated
ID will be a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>`
ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>`
instance.
docs/reference/method/MongoDBUpdateResult-getUpsertedId.txt
View file @
44e59fed
...
...
@@ -29,7 +29,7 @@ upserted, ``null`` will be returned.
If the document had an ID prior to upserting (i.e. the server did not need to
generate an ID), this will contain its ``_id`` field value. Any server-generated
ID will be a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>`
ID will be a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>`
instance.
Errors/Exceptions
...
...
docs/tutorial/commands.txt
View file @
44e59fed
...
...
@@ -74,7 +74,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(3) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#3 (1) {
object(MongoDB\BSON\ObjectI
d
)#3 (1) {
["oid"]=>
string(24) "55cba2486c522cafdb059bed"
}
...
...
@@ -113,7 +113,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(3) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
string(24) "55cba2476c522cafdb0544df"
}
...
...
@@ -152,7 +152,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(3) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#20 (1) {
object(MongoDB\BSON\ObjectI
d
)#20 (1) {
["oid"]=>
string(24) "55cba2476c522cafdb053c92"
}
...
...
docs/tutorial/crud.txt
View file @
44e59fed
...
...
@@ -145,7 +145,7 @@ The output would then resemble::
``"94301"``. The same criteria would not have matched a document with an
integer value of ``94301`` due to MongoDB's :manual:`comparison rules for
BSON types </reference/bson-type-comparison-order>`. Similarly, users should
use a :php:`MongoDB\\BSON\\ObjectI
D
<class.mongodb-bson-objectid>` object
use a :php:`MongoDB\\BSON\\ObjectI
d
<class.mongodb-bson-objectid>` object
when matching an ``_id`` with an :manual:`ObjectId </reference/object-id/>`
value, as strings and ObjectIds are not directly comparable.
...
...
@@ -237,7 +237,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#8 (1) {
object(MongoDB\BSON\ObjectI
d
)#8 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f983"
}
...
...
@@ -253,7 +253,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#12 (1) {
object(MongoDB\BSON\ObjectI
d
)#12 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f98d"
}
...
...
@@ -269,7 +269,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#10 (1) {
object(MongoDB\BSON\ObjectI
d
)#10 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f99b"
}
...
...
@@ -285,7 +285,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(4) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#13 (1) {
object(MongoDB\BSON\ObjectI
d
)#13 (1) {
["oid"]=>
string(24) "576023c6b02fa9281da3f9a8"
}
...
...
@@ -658,7 +658,7 @@ The output would then resemble::
["storage":"ArrayObject":private]=>
array(3) {
["_id"]=>
object(MongoDB\BSON\ObjectI
D
)#15 (1) {
object(MongoDB\BSON\ObjectI
d
)#15 (1) {
["oid"]=>
string(24) "57509c4406d7241dad86e7c3"
}
...
...
src/BulkWriteResult.php
View file @
44e59fed
...
...
@@ -84,7 +84,7 @@ class BulkWriteResult
* The index of each ID in the map corresponds to each document's position
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* the driver did not generate an ID), the index will contain its "_id"
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
D
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
d
* instance.
*
* @return mixed[]
...
...
@@ -157,7 +157,7 @@ class BulkWriteResult
* The index of each ID in the map corresponds to each document's position
* in bulk operation. If a document had an ID prior to upserting (i.e. the
* server did not need to generate an ID), this will contain its "_id". Any
* server-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* server-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
* This method should only be called if the write was acknowledged.
*
...
...
src/InsertManyResult.php
View file @
44e59fed
...
...
@@ -66,7 +66,7 @@ class InsertManyResult
* The index of each ID in the map corresponds to each document's position
* in the bulk operation. If a document had an ID prior to inserting (i.e.
* the driver did not generate an ID), the index will contain its "_id"
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
D
* field value. Any driver-generated ID will be a MongoDB\BSON\ObjectI
d
* instance.
*
* @return mixed[]
...
...
src/InsertOneResult.php
View file @
44e59fed
...
...
@@ -65,7 +65,7 @@ class InsertOneResult
*
* If the document had an ID prior to inserting (i.e. the driver did not
* need to generate an ID), this will contain its "_id". Any
* driver-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* driver-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
* @return mixed
*/
...
...
src/UpdateResult.php
View file @
44e59fed
...
...
@@ -101,7 +101,7 @@ class UpdateResult
*
* If the document had an ID prior to upserting (i.e. the server did not
* need to generate an ID), this will contain its "_id". Any
* server-generated ID will be a MongoDB\BSON\ObjectI
D
instance.
* server-generated ID will be a MongoDB\BSON\ObjectI
d
instance.
*
* This value is undefined (i.e. null) if an upsert did not take place.
*
...
...
tests/DocumentationExamplesTest.php
View file @
44e59fed
...
...
@@ -46,7 +46,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
// End Example 1
$this
->
assertSame
(
1
,
$insertOneResult
->
getInsertedCount
());
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$insertOneResult
->
getInsertedId
());
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$insertOneResult
->
getInsertedId
());
$this
->
assertInventoryCount
(
1
);
// Start Example 2
...
...
@@ -85,7 +85,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
3
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
3
);
}
...
...
@@ -131,7 +131,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
@@ -234,7 +234,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
@@ -314,7 +314,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
@@ -424,7 +424,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
@@ -565,7 +565,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
@@ -785,7 +785,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
10
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
10
);
...
...
@@ -897,7 +897,7 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this
->
assertSame
(
5
,
$insertManyResult
->
getInsertedCount
());
foreach
(
$insertManyResult
->
getInsertedIds
()
as
$id
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D
'
,
$id
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d
'
,
$id
);
}
$this
->
assertInventoryCount
(
5
);
...
...
tests/FunctionalTestCase.php
View file @
44e59fed
...
...
@@ -41,11 +41,11 @@ abstract class FunctionalTestCase extends TestCase
$this
->
assertEquals
(
1
,
$document
[
'ok'
]);
}
protected
function
assertSameObjectI
D
(
$expectedObjectID
,
$actualObjectID
)
protected
function
assertSameObjectI
d
(
$expectedObjectId
,
$actualObjectId
)
{
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D'
,
$expectedObjectID
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
D'
,
$actualObjectID
);
$this
->
assertEquals
((
string
)
$expectedObjectI
D
,
(
string
)
$actualObjectID
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d'
,
$expectedObjectId
);
$this
->
assertInstanceOf
(
'MongoDB\BSON\ObjectI
d'
,
$actualObjectId
);
$this
->
assertEquals
((
string
)
$expectedObjectI
d
,
(
string
)
$actualObjectId
);
}
protected
function
assertSameDocument
(
$expectedDocument
,
$actualDocument
)
...
...
tests/GridFS/BucketFunctionalTest.php
View file @
44e59fed
...
...
@@ -388,7 +388,7 @@ class BucketFunctionalTest extends FunctionalTestCase
$fileDocument
=
$this
->
bucket
->
getFileDocumentForStream
(
$stream
);
$this
->
assertSameObjectI
D
(
$id
,
$fileDocument
->
_id
);
$this
->
assertSameObjectI
d
(
$id
,
$fileDocument
->
_id
);
$this
->
assertSame
(
'filename'
,
$fileDocument
->
filename
);
$this
->
assertSame
(
6
,
$fileDocument
->
length
);
$this
->
assertSameDocument
(
$metadata
,
$fileDocument
->
metadata
);
...
...
@@ -435,7 +435,7 @@ class BucketFunctionalTest extends FunctionalTestCase
$id
=
$this
->
bucket
->
uploadFromStream
(
'filename'
,
$this
->
createStream
(
'foobar'
));
$stream
=
$this
->
bucket
->
openDownloadStream
(
$id
);
$this
->
assertSameObjectI
D
(
$id
,
$this
->
bucket
->
getFileIdForStream
(
$stream
));
$this
->
assertSameObjectI
d
(
$id
,
$this
->
bucket
->
getFileIdForStream
(
$stream
));
}
public
function
testGetFileIdForStreamWithWritableStream
()
...
...
tests/GridFS/SpecFunctionalTest.php
View file @
44e59fed
...
...
@@ -118,7 +118,7 @@ class SpecFunctionalTest extends FunctionalTestCase
/**
* Convert encoded types in the array and return the modified array.
*
* Nested arrays with "$oid" and "$date" keys will be converted to ObjectI
D
* Nested arrays with "$oid" and "$date" keys will be converted to ObjectI
d
* and UTCDateTime instances, respectively. Nested arrays with "$hex" keys
* will be converted to a string or Binary object.
*
...
...
tests/Operation/MapReduceTest.php
View file @
44e59fed
...
...
@@ -3,7 +3,7 @@
namespace
MongoDB\Tests\Operation
;
use
MongoDB\BSON\Javascript
;
use
MongoDB\BSON\ObjectI
D
;
use
MongoDB\BSON\ObjectI
d
;
use
MongoDB\Operation\MapReduce
;
use
stdClass
;
...
...
@@ -104,6 +104,6 @@ class MapReduceTest extends TestCase
private
function
getInvalidJavascriptValues
()
{
return
[
123
,
3.14
,
'foo'
,
true
,
[],
new
stdClass
,
new
ObjectI
D
];
return
[
123
,
3.14
,
'foo'
,
true
,
[],
new
stdClass
,
new
ObjectI
d
];
}
}
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