Skip to content

Commit 94ee50e

Browse files
committed
PHPC-1004: Rename ObjectID to ObjectId
1 parent aef7106 commit 94ee50e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+192
-192
lines changed

config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ if test "$MONGODB" != "no"; then
164164
src/BSON/MaxKeyInterface.c \
165165
src/BSON/MinKey.c \
166166
src/BSON/MinKeyInterface.c \
167-
src/BSON/ObjectID.c \
168-
src/BSON/ObjectIDInterface.c \
167+
src/BSON/ObjectId.c \
168+
src/BSON/ObjectIdInterface.c \
169169
src/BSON/Persistable.c \
170170
src/BSON/Regex.c \
171171
src/BSON/RegexInterface.c \

config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if (PHP_MONGODB != "no") {
8484

8585
EXTENSION("mongodb", "php_phongo.c phongo_compat.c", null, PHP_MONGODB_CFLAGS);
8686
ADD_SOURCES(configure_module_dirname + "/src", "bson.c bson-encode.c", "mongodb");
87-
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Binary.c BinaryInterface.c Decimal128.c Decimal128Interface.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectID.c ObjectIDInterface.c Persistable.c Regex.c RegexInterface.c Serializable.c Timestamp.c TimestampInterface.c Type.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c", "mongodb");
87+
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Binary.c BinaryInterface.c Decimal128.c Decimal128Interface.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectId.c ObjectIdInterface.c Persistable.c Regex.c RegexInterface.c Serializable.c Timestamp.c TimestampInterface.c Type.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c", "mongodb");
8888
ADD_SOURCES(configure_module_dirname + "/src/MongoDB", "BulkWrite.c Command.c Cursor.c CursorId.c Manager.c Query.c ReadConcern.c ReadPreference.c Server.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c", "mongodb");
8989
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Exception", "AuthenticationException.c BulkWriteException.c ConnectionException.c ConnectionTimeoutException.c Exception.c ExecutionTimeoutException.c InvalidArgumentException.c LogicException.c RuntimeException.c SSLConnectionException.c UnexpectedValueException.c WriteException.c", "mongodb");
9090
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Monitoring", "CommandFailedEvent.c CommandStartedEvent.c CommandSubscriber.c CommandSucceededEvent.c Subscriber.c functions.c", "mongodb");

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ static const char *php_phongo_bson_type_to_string(bson_type_t type) /* {{{ */
937937
case BSON_TYPE_ARRAY: return "array";
938938
case BSON_TYPE_BINARY: return "Binary";
939939
case BSON_TYPE_UNDEFINED: return "undefined";
940-
case BSON_TYPE_OID: return "ObjectID";
940+
case BSON_TYPE_OID: return "ObjectId";
941941
case BSON_TYPE_BOOL: return "boolean";
942942
case BSON_TYPE_DATE_TIME: return "UTCDateTime";
943943
case BSON_TYPE_NULL: return "null";

serialization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ map from each supported data type to a class of your own, providing it
233233
implements the ``MongoDB\BSON\TypeWrapper`` interface.
234234

235235
The supported data types are Binary, Decimal128, Javascript, MaxKey, MinKey,
236-
ObjectID, Regex, Timestamp, and UTCDateTime.
236+
ObjectId, Regex, Timestamp, and UTCDateTime.
237237

238238
The ``MongoDB\BSON\TypeWrapper`` interface defines two functions:
239239
``createFromBSONType()``, a factory method which takes a ``MongoDB\BSON\Type``

src/BSON/ObjectID.c renamed to src/BSON/ObjectId.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static bool php_phongo_objectid_init_from_hex_string(php_phongo_objectid_t *inte
6060
return true;
6161
}
6262

63-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error parsing ObjectID string: %s", hex);
63+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error parsing ObjectId string: %s", hex);
6464

6565
return false;
6666
} /* }}} */
@@ -89,9 +89,9 @@ static bool php_phongo_objectid_init_from_hash(php_phongo_objectid_t *intern, Ha
8989
return false;
9090
} /* }}} */
9191

92-
/* {{{ proto void MongoDB\BSON\ObjectID::__construct([string $id])
93-
Constructs a new BSON ObjectID type, optionally from a hex string. */
94-
static PHP_METHOD(ObjectID, __construct)
92+
/* {{{ proto void MongoDB\BSON\ObjectId::__construct([string $id])
93+
Constructs a new BSON ObjectId type, optionally from a hex string. */
94+
static PHP_METHOD(ObjectId, __construct)
9595
{
9696
php_phongo_objectid_t *intern;
9797
zend_error_handling error_handling;
@@ -115,9 +115,9 @@ static PHP_METHOD(ObjectID, __construct)
115115
}
116116
} /* }}} */
117117

118-
/* {{{ proto integer MongoDB\BSON\ObjectID::getTimestamp()
118+
/* {{{ proto integer MongoDB\BSON\ObjectId::getTimestamp()
119119
*/
120-
static PHP_METHOD(ObjectID, getTimestamp)
120+
static PHP_METHOD(ObjectId, getTimestamp)
121121
{
122122
php_phongo_objectid_t *intern;
123123
bson_oid_t tmp_oid;
@@ -132,9 +132,9 @@ static PHP_METHOD(ObjectID, getTimestamp)
132132
RETVAL_LONG(bson_oid_get_time_t(&tmp_oid));
133133
} /* }}} */
134134

135-
/* {{{ proto MongoDB\BSON\ObjectID::__set_state(array $properties)
135+
/* {{{ proto MongoDB\BSON\ObjectId::__set_state(array $properties)
136136
*/
137-
static PHP_METHOD(ObjectID, __set_state)
137+
static PHP_METHOD(ObjectId, __set_state)
138138
{
139139
php_phongo_objectid_t *intern;
140140
HashTable *props;
@@ -152,9 +152,9 @@ static PHP_METHOD(ObjectID, __set_state)
152152
php_phongo_objectid_init_from_hash(intern, props TSRMLS_CC);
153153
} /* }}} */
154154

155-
/* {{{ proto string MongoDB\BSON\ObjectID::__toString()
155+
/* {{{ proto string MongoDB\BSON\ObjectId::__toString()
156156
*/
157-
static PHP_METHOD(ObjectID, __toString)
157+
static PHP_METHOD(ObjectId, __toString)
158158
{
159159
php_phongo_objectid_t *intern;
160160

@@ -169,9 +169,9 @@ static PHP_METHOD(ObjectID, __toString)
169169
PHONGO_RETURN_STRINGL(intern->oid, 24);
170170
} /* }}} */
171171

172-
/* {{{ proto array MongoDB\BSON\ObjectID::jsonSerialize()
172+
/* {{{ proto array MongoDB\BSON\ObjectId::jsonSerialize()
173173
*/
174-
static PHP_METHOD(ObjectID, jsonSerialize)
174+
static PHP_METHOD(ObjectId, jsonSerialize)
175175
{
176176
php_phongo_objectid_t *intern;
177177

@@ -185,9 +185,9 @@ static PHP_METHOD(ObjectID, jsonSerialize)
185185
ADD_ASSOC_STRINGL(return_value, "$oid", intern->oid, 24);
186186
} /* }}} */
187187

188-
/* {{{ proto string MongoDB\BSON\ObjectID::serialize()
188+
/* {{{ proto string MongoDB\BSON\ObjectId::serialize()
189189
*/
190-
static PHP_METHOD(ObjectID, serialize)
190+
static PHP_METHOD(ObjectId, serialize)
191191
{
192192
php_phongo_objectid_t *intern;
193193
#if PHP_VERSION_ID >= 70000
@@ -224,9 +224,9 @@ static PHP_METHOD(ObjectID, serialize)
224224
zval_ptr_dtor(&retval);
225225
} /* }}} */
226226

227-
/* {{{ proto void MongoDB\BSON\ObjectID::unserialize(string $serialized)
227+
/* {{{ proto void MongoDB\BSON\ObjectId::unserialize(string $serialized)
228228
*/
229-
static PHP_METHOD(ObjectID, unserialize)
229+
static PHP_METHOD(ObjectId, unserialize)
230230
{
231231
php_phongo_objectid_t *intern;
232232
zend_error_handling error_handling;
@@ -270,35 +270,35 @@ static PHP_METHOD(ObjectID, unserialize)
270270
zval_ptr_dtor(&props);
271271
} /* }}} */
272272

273-
/* {{{ MongoDB\BSON\ObjectID function entries */
274-
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID___construct, 0, 0, 0)
273+
/* {{{ MongoDB\BSON\ObjectId function entries */
274+
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId___construct, 0, 0, 0)
275275
ZEND_ARG_INFO(0, id)
276276
ZEND_END_ARG_INFO()
277277

278-
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID___set_state, 0, 0, 1)
278+
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId___set_state, 0, 0, 1)
279279
ZEND_ARG_ARRAY_INFO(0, properties, 0)
280280
ZEND_END_ARG_INFO()
281281

282-
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID_unserialize, 0, 0, 1)
282+
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId_unserialize, 0, 0, 1)
283283
ZEND_ARG_INFO(0, serialized)
284284
ZEND_END_ARG_INFO()
285285

286-
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID_void, 0, 0, 0)
286+
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId_void, 0, 0, 0)
287287
ZEND_END_ARG_INFO()
288288

289289
static zend_function_entry php_phongo_objectid_me[] = {
290-
PHP_ME(ObjectID, __construct, ai_ObjectID___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
291-
PHP_ME(ObjectID, getTimestamp, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
292-
PHP_ME(ObjectID, __set_state, ai_ObjectID___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
293-
PHP_ME(ObjectID, __toString, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
294-
PHP_ME(ObjectID, jsonSerialize, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
295-
PHP_ME(ObjectID, serialize, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
296-
PHP_ME(ObjectID, unserialize, ai_ObjectID_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
290+
PHP_ME(ObjectId, __construct, ai_ObjectId___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
291+
PHP_ME(ObjectId, getTimestamp, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
292+
PHP_ME(ObjectId, __set_state, ai_ObjectId___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
293+
PHP_ME(ObjectId, __toString, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
294+
PHP_ME(ObjectId, jsonSerialize, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
295+
PHP_ME(ObjectId, serialize, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
296+
PHP_ME(ObjectId, unserialize, ai_ObjectId_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
297297
PHP_FE_END
298298
};
299299
/* }}} */
300300

301-
/* {{{ MongoDB\BSON\ObjectID object handlers */
301+
/* {{{ MongoDB\BSON\ObjectId object handlers */
302302
static zend_object_handlers php_phongo_handler_objectid;
303303

304304
static void php_phongo_objectid_free_object(phongo_free_object_arg *object TSRMLS_DC) /* {{{ */
@@ -409,7 +409,7 @@ void php_phongo_objectid_init_ce(INIT_FUNC_ARGS) /* {{{ */
409409
{
410410
zend_class_entry ce;
411411

412-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectID", php_phongo_objectid_me);
412+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectId", php_phongo_objectid_me);
413413
php_phongo_objectid_ce = zend_register_internal_class(&ce TSRMLS_CC);
414414
php_phongo_objectid_ce->create_object = php_phongo_objectid_create_object;
415415
PHONGO_CE_FINAL(php_phongo_objectid_ce);

src/BSON/ObjectIDInterface.c renamed to src/BSON/ObjectIdInterface.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
zend_class_entry *php_phongo_objectid_interface_ce;
2727

28-
/* {{{ MongoDB\BSON\ObjectIDInterface function entries */
29-
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectIDInterface_void, 0, 0, 0)
28+
/* {{{ MongoDB\BSON\ObjectIdInterface function entries */
29+
ZEND_BEGIN_ARG_INFO_EX(ai_ObjectIdInterface_void, 0, 0, 0)
3030
ZEND_END_ARG_INFO()
3131

3232
static zend_function_entry php_phongo_objectid_interface_me[] = {
33-
ZEND_ABSTRACT_ME(ObjectIDInterface, getTimestamp, ai_ObjectIDInterface_void)
34-
ZEND_ABSTRACT_ME(ObjectIDInterface, __toString, ai_ObjectIDInterface_void)
33+
ZEND_ABSTRACT_ME(ObjectIdInterface, getTimestamp, ai_ObjectIdInterface_void)
34+
ZEND_ABSTRACT_ME(ObjectIdInterface, __toString, ai_ObjectIdInterface_void)
3535
PHP_FE_END
3636
};
3737
/* }}} */
@@ -40,7 +40,7 @@ void php_phongo_objectid_interface_init_ce(INIT_FUNC_ARGS) /* {{{ */
4040
{
4141
zend_class_entry ce;
4242

43-
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectIDInterface", php_phongo_objectid_interface_me);
43+
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectIdInterface", php_phongo_objectid_interface_me);
4444
php_phongo_objectid_interface_ce = zend_register_internal_interface(&ce TSRMLS_CC);
4545
} /* }}} */
4646

src/MongoDB/BulkWrite.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ static PHP_METHOD(BulkWrite, insert)
246246
/* If the insert document appears to be a legacy index, instruct libmongoc
247247
* to allow dots in BSON keys by setting the "legacyIndex" option.
248248
*
249-
* Note: php_phongo_zval_to_bson() may have added an ObjectID if the "_id"
249+
* Note: php_phongo_zval_to_bson() may have added an ObjectId if the "_id"
250250
* field was unset. We don't know at this point if the insert is destined
251251
* for a pre-2.6 server's "system.indexes" collection, but legacy index
252252
* creation will ignore the "_id" so there is no harm in leaving it. In the
253253
* event php_phongo_bulkwrite_insert_is_legacy_index() returns a false
254-
* positive, we absolutely want ObjectID added if "_id" was unset. */
254+
* positive, we absolutely want ObjectId added if "_id" was unset. */
255255
if (php_phongo_bulkwrite_insert_is_legacy_index(&bdocument) &&
256256
!BSON_APPEND_BOOL(&boptions, "legacyIndex", true)) {
257257
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error appending \"legacyIndex\" option");

tests/apm/overview.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ object(MongoDB\Driver\Monitoring\CommandStartedEvent)#%d (%d) {
113113
["decimal"]=>
114114
int(12345678)
115115
["_id"]=>
116-
object(MongoDB\BSON\ObjectID)#%d (%d) {
116+
object(MongoDB\BSON\ObjectId)#%d (%d) {
117117
["oid"]=>
118118
string(24) "%s"
119119
}
@@ -198,7 +198,7 @@ array(%d) {
198198
[0]=>
199199
object(stdClass)#%d (%d) {
200200
["_id"]=>
201-
object(MongoDB\BSON\ObjectID)#%d (%d) {
201+
object(MongoDB\BSON\ObjectId)#%d (%d) {
202202
["oid"]=>
203203
string(24) "%s"
204204
}

tests/bson/bson-fromPHP_error-003.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ MongoDB\BSON\Type instance MongoDB\BSON\MinKey cannot be serialized as a root el
4141
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
4242
MongoDB\BSON\Type instance MongoDB\BSON\MaxKey cannot be serialized as a root element
4343
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
44-
MongoDB\BSON\Type instance MongoDB\BSON\ObjectID cannot be serialized as a root element
44+
MongoDB\BSON\Type instance MongoDB\BSON\ObjectId cannot be serialized as a root element
4545
OK: Got MongoDB\Driver\Exception\UnexpectedValueException
4646
MongoDB\BSON\Type instance MongoDB\BSON\Regex cannot be serialized as a root element
4747
OK: Got MongoDB\Driver\Exception\UnexpectedValueException

tests/bson/bson-generate-document-id.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ array(3) {
4646
string(8) "New York"
4747
}
4848
["_id"]=>
49-
object(%s\ObjectID)#%d (%d) {
49+
object(%s\ObjectId)#%d (%d) {
5050
["oid"]=>
5151
string(24) "%s"
5252
}
@@ -55,7 +55,7 @@ array(3) {
5555
Dumping fetched user document:
5656
object(stdClass)#%d (3) {
5757
["_id"]=>
58-
object(%s\ObjectID)#%d (%d) {
58+
object(%s\ObjectId)#%d (%d) {
5959
["oid"]=>
6060
string(24) "%s"
6161
}

tests/bson/bson-javascript-002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $tests = array(
1414
),
1515
array(
1616
'function foo() { return id; }',
17-
array('id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')),
17+
array('id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')),
1818
),
1919
);
2020

@@ -51,7 +51,7 @@ object(MongoDB\BSON\Javascript)#%d (%d) {
5151
["scope"]=>
5252
object(stdClass)#%d (%d) {
5353
["id"]=>
54-
object(MongoDB\BSON\ObjectID)#%d (%d) {
54+
object(MongoDB\BSON\ObjectId)#%d (%d) {
5555
["oid"]=>
5656
string(24) "53e2a1c40640fd72175d4603"
5757
}

tests/bson/bson-javascript-getScope-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ object(stdClass)#%d (%d) {
3030
}
3131
object(stdClass)#%d (%d) {
3232
["id"]=>
33-
object(MongoDB\BSON\ObjectID)#%d (%d) {
33+
object(MongoDB\BSON\ObjectId)#%d (%d) {
3434
["oid"]=>
3535
string(24) "53e2a1c40640fd72175d4603"
3636
}

tests/bson/bson-javascript-serialization-001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,20 @@ object(MongoDB\BSON\Javascript)#%d (%d) {
7979
["scope"]=>
8080
object(stdClass)#%d (%d) {
8181
["id"]=>
82-
object(MongoDB\BSON\ObjectID)#%d (%d) {
82+
object(MongoDB\BSON\ObjectId)#%d (%d) {
8383
["oid"]=>
8484
string(24) "53e2a1c40640fd72175d4603"
8585
}
8686
}
8787
}
88-
string(213) "C:23:"MongoDB\BSON\Javascript":176:{a:2:{s:4:"code";s:29:"function foo() { return id; }";s:5:"scope";O:8:"stdClass":1:{s:2:"id";C:21:"MongoDB\BSON\ObjectID":48:{a:1:{s:3:"oid";s:24:"53e2a1c40640fd72175d4603";}}}}}"
88+
string(213) "C:23:"MongoDB\BSON\Javascript":176:{a:2:{s:4:"code";s:29:"function foo() { return id; }";s:5:"scope";O:8:"stdClass":1:{s:2:"id";C:21:"MongoDB\BSON\ObjectId":48:{a:1:{s:3:"oid";s:24:"53e2a1c40640fd72175d4603";}}}}}"
8989
object(MongoDB\BSON\Javascript)#%d (%d) {
9090
["code"]=>
9191
string(29) "function foo() { return id; }"
9292
["scope"]=>
9393
object(stdClass)#%d (%d) {
9494
["id"]=>
95-
object(MongoDB\BSON\ObjectID)#%d (%d) {
95+
object(MongoDB\BSON\ObjectId)#%d (%d) {
9696
["oid"]=>
9797
string(24) "53e2a1c40640fd72175d4603"
9898
}

tests/bson/bson-javascript-set_state-001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ MongoDB\BSON\Javascript::__set_state(array(
5555
%w'scope' =>
5656
stdClass::__set_state(array(
5757
%w'id' =>
58-
MongoDB\BSON\ObjectID::__set_state(array(
58+
MongoDB\BSON\ObjectId::__set_state(array(
5959
%w'oid' => '53e2a1c40640fd72175d4603',
6060
)),
6161
)),

tests/bson/bson-objectid-001.phpt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
--TEST--
2-
MongoDB\BSON\ObjectID #001
2+
MongoDB\BSON\ObjectId #001
33
--FILE--
44
<?php
55

66
require_once __DIR__ . '/../utils/tools.php';
77

8-
$sameid = new MongoDB\BSON\ObjectID("53e2a1c40640fd72175d4603");
8+
$sameid = new MongoDB\BSON\ObjectId("53e2a1c40640fd72175d4603");
99
$samestd = new stdClass;
1010
$samestd->my = $sameid;
1111
$samearr = array("my" => $sameid);
1212

1313

1414
$std = new stdclass;
15-
$std->_id = new MongoDB\BSON\ObjectID;
15+
$std->_id = new MongoDB\BSON\ObjectId;
1616

1717
$array = array(
18-
"_id" => new MongoDB\BSON\ObjectID,
19-
"id" => new MongoDB\BSON\ObjectID,
20-
"d" => new MongoDB\BSON\ObjectID,
18+
"_id" => new MongoDB\BSON\ObjectId,
19+
"id" => new MongoDB\BSON\ObjectId,
20+
"d" => new MongoDB\BSON\ObjectId,
2121
);
2222

23-
$pregenerated = new MongoDB\BSON\ObjectID("53e28b650640fd3162152de1");
23+
$pregenerated = new MongoDB\BSON\ObjectId("53e28b650640fd3162152de1");
2424

2525
$tests = array(
2626
$array,
@@ -40,19 +40,19 @@ foreach($tests as $n => $test) {
4040
}
4141

4242
throws(function() {
43-
$id = new MongoDB\BSON\ObjectID("53e28b650640fd3162152de12");
43+
$id = new MongoDB\BSON\ObjectId("53e28b650640fd3162152de12");
4444
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
4545

4646
throws(function() {
47-
$id = new MongoDB\BSON\ObjectID("53e28b650640fd3162152dg1");
47+
$id = new MongoDB\BSON\ObjectId("53e28b650640fd3162152dg1");
4848
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
4949

5050
throws(function() {
51-
$id = new MongoDB\BSON\ObjectID("-3e28b650640fd3162152da1");
51+
$id = new MongoDB\BSON\ObjectId("-3e28b650640fd3162152da1");
5252
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
5353

5454
throws(function() {
55-
$id = new MongoDB\BSON\ObjectID(" 3e28b650640fd3162152da1");
55+
$id = new MongoDB\BSON\ObjectId(" 3e28b650640fd3162152da1");
5656
}, "MongoDB\\Driver\\Exception\\InvalidArgumentException");
5757

5858

0 commit comments

Comments
 (0)