diff --git a/config.m4 b/config.m4 index bec0a7e1c..66fea8836 100644 --- a/config.m4 +++ b/config.m4 @@ -164,8 +164,8 @@ if test "$MONGODB" != "no"; then src/BSON/MaxKeyInterface.c \ src/BSON/MinKey.c \ src/BSON/MinKeyInterface.c \ - src/BSON/ObjectID.c \ - src/BSON/ObjectIDInterface.c \ + src/BSON/ObjectId.c \ + src/BSON/ObjectIdInterface.c \ src/BSON/Persistable.c \ src/BSON/Regex.c \ src/BSON/RegexInterface.c \ @@ -180,7 +180,7 @@ if test "$MONGODB" != "no"; then src/MongoDB/BulkWrite.c \ src/MongoDB/Command.c \ src/MongoDB/Cursor.c \ - src/MongoDB/CursorID.c \ + src/MongoDB/CursorId.c \ src/MongoDB/Manager.c \ src/MongoDB/Query.c \ src/MongoDB/ReadConcern.c \ diff --git a/config.w32 b/config.w32 index 0d9f40dda..f0a209fc4 100644 --- a/config.w32 +++ b/config.w32 @@ -84,8 +84,8 @@ if (PHP_MONGODB != "no") { EXTENSION("mongodb", "php_phongo.c phongo_compat.c", null, PHP_MONGODB_CFLAGS); ADD_SOURCES(configure_module_dirname + "/src", "bson.c bson-encode.c", "mongodb"); - 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"); - 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"); + 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"); + 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"); 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"); ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Monitoring", "CommandFailedEvent.c CommandStartedEvent.c CommandSubscriber.c CommandSucceededEvent.c Subscriber.c functions.c", "mongodb"); ADD_SOURCES(configure_module_dirname + "/src/libbson/src/bson", PHP_MONGODB_BSON_SOURCES, "mongodb"); diff --git a/php_phongo.c b/php_phongo.c index fb0e35962..c932e3372 100644 --- a/php_phongo.c +++ b/php_phongo.c @@ -937,7 +937,7 @@ static const char *php_phongo_bson_type_to_string(bson_type_t type) /* {{{ */ case BSON_TYPE_ARRAY: return "array"; case BSON_TYPE_BINARY: return "Binary"; case BSON_TYPE_UNDEFINED: return "undefined"; - case BSON_TYPE_OID: return "ObjectID"; + case BSON_TYPE_OID: return "ObjectId"; case BSON_TYPE_BOOL: return "boolean"; case BSON_TYPE_DATE_TIME: return "UTCDateTime"; case BSON_TYPE_NULL: return "null"; diff --git a/serialization.rst b/serialization.rst index 47554492d..7414e6380 100644 --- a/serialization.rst +++ b/serialization.rst @@ -233,7 +233,7 @@ map from each supported data type to a class of your own, providing it implements the ``MongoDB\BSON\TypeWrapper`` interface. The supported data types are Binary, Decimal128, Javascript, MaxKey, MinKey, -ObjectID, Regex, Timestamp, and UTCDateTime. +ObjectId, Regex, Timestamp, and UTCDateTime. The ``MongoDB\BSON\TypeWrapper`` interface defines two functions: ``createFromBSONType()``, a factory method which takes a ``MongoDB\BSON\Type`` diff --git a/src/BSON/ObjectID.c b/src/BSON/ObjectId.c similarity index 87% rename from src/BSON/ObjectID.c rename to src/BSON/ObjectId.c index 6dd470b03..2e85c8a5b 100644 --- a/src/BSON/ObjectID.c +++ b/src/BSON/ObjectId.c @@ -60,7 +60,7 @@ static bool php_phongo_objectid_init_from_hex_string(php_phongo_objectid_t *inte return true; } - phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error parsing ObjectID string: %s", hex); + phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error parsing ObjectId string: %s", hex); return false; } /* }}} */ @@ -89,9 +89,9 @@ static bool php_phongo_objectid_init_from_hash(php_phongo_objectid_t *intern, Ha return false; } /* }}} */ -/* {{{ proto void MongoDB\BSON\ObjectID::__construct([string $id]) - Constructs a new BSON ObjectID type, optionally from a hex string. */ -static PHP_METHOD(ObjectID, __construct) +/* {{{ proto void MongoDB\BSON\ObjectId::__construct([string $id]) + Constructs a new BSON ObjectId type, optionally from a hex string. */ +static PHP_METHOD(ObjectId, __construct) { php_phongo_objectid_t *intern; zend_error_handling error_handling; @@ -115,9 +115,9 @@ static PHP_METHOD(ObjectID, __construct) } } /* }}} */ -/* {{{ proto integer MongoDB\BSON\ObjectID::getTimestamp() +/* {{{ proto integer MongoDB\BSON\ObjectId::getTimestamp() */ -static PHP_METHOD(ObjectID, getTimestamp) +static PHP_METHOD(ObjectId, getTimestamp) { php_phongo_objectid_t *intern; bson_oid_t tmp_oid; @@ -132,9 +132,9 @@ static PHP_METHOD(ObjectID, getTimestamp) RETVAL_LONG(bson_oid_get_time_t(&tmp_oid)); } /* }}} */ -/* {{{ proto MongoDB\BSON\ObjectID::__set_state(array $properties) +/* {{{ proto MongoDB\BSON\ObjectId::__set_state(array $properties) */ -static PHP_METHOD(ObjectID, __set_state) +static PHP_METHOD(ObjectId, __set_state) { php_phongo_objectid_t *intern; HashTable *props; @@ -152,9 +152,9 @@ static PHP_METHOD(ObjectID, __set_state) php_phongo_objectid_init_from_hash(intern, props TSRMLS_CC); } /* }}} */ -/* {{{ proto string MongoDB\BSON\ObjectID::__toString() +/* {{{ proto string MongoDB\BSON\ObjectId::__toString() */ -static PHP_METHOD(ObjectID, __toString) +static PHP_METHOD(ObjectId, __toString) { php_phongo_objectid_t *intern; @@ -169,9 +169,9 @@ static PHP_METHOD(ObjectID, __toString) PHONGO_RETURN_STRINGL(intern->oid, 24); } /* }}} */ -/* {{{ proto array MongoDB\BSON\ObjectID::jsonSerialize() +/* {{{ proto array MongoDB\BSON\ObjectId::jsonSerialize() */ -static PHP_METHOD(ObjectID, jsonSerialize) +static PHP_METHOD(ObjectId, jsonSerialize) { php_phongo_objectid_t *intern; @@ -185,9 +185,9 @@ static PHP_METHOD(ObjectID, jsonSerialize) ADD_ASSOC_STRINGL(return_value, "$oid", intern->oid, 24); } /* }}} */ -/* {{{ proto string MongoDB\BSON\ObjectID::serialize() +/* {{{ proto string MongoDB\BSON\ObjectId::serialize() */ -static PHP_METHOD(ObjectID, serialize) +static PHP_METHOD(ObjectId, serialize) { php_phongo_objectid_t *intern; #if PHP_VERSION_ID >= 70000 @@ -224,9 +224,9 @@ static PHP_METHOD(ObjectID, serialize) zval_ptr_dtor(&retval); } /* }}} */ -/* {{{ proto void MongoDB\BSON\ObjectID::unserialize(string $serialized) +/* {{{ proto void MongoDB\BSON\ObjectId::unserialize(string $serialized) */ -static PHP_METHOD(ObjectID, unserialize) +static PHP_METHOD(ObjectId, unserialize) { php_phongo_objectid_t *intern; zend_error_handling error_handling; @@ -270,35 +270,35 @@ static PHP_METHOD(ObjectID, unserialize) zval_ptr_dtor(&props); } /* }}} */ -/* {{{ MongoDB\BSON\ObjectID function entries */ -ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID___construct, 0, 0, 0) +/* {{{ MongoDB\BSON\ObjectId function entries */ +ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId___construct, 0, 0, 0) ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID___set_state, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId___set_state, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, properties, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID_unserialize, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId_unserialize, 0, 0, 1) ZEND_ARG_INFO(0, serialized) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(ai_ObjectID_void, 0, 0, 0) +ZEND_BEGIN_ARG_INFO_EX(ai_ObjectId_void, 0, 0, 0) ZEND_END_ARG_INFO() static zend_function_entry php_phongo_objectid_me[] = { - PHP_ME(ObjectID, __construct, ai_ObjectID___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(ObjectID, getTimestamp, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(ObjectID, __set_state, ai_ObjectID___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(ObjectID, __toString, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(ObjectID, jsonSerialize, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(ObjectID, serialize, ai_ObjectID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(ObjectID, unserialize, ai_ObjectID_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, __construct, ai_ObjectId___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, getTimestamp, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, __set_state, ai_ObjectId___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(ObjectId, __toString, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, jsonSerialize, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, serialize, ai_ObjectId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(ObjectId, unserialize, ai_ObjectId_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; /* }}} */ -/* {{{ MongoDB\BSON\ObjectID object handlers */ +/* {{{ MongoDB\BSON\ObjectId object handlers */ static zend_object_handlers php_phongo_handler_objectid; 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) /* {{{ */ { zend_class_entry ce; - INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectID", php_phongo_objectid_me); + INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectId", php_phongo_objectid_me); php_phongo_objectid_ce = zend_register_internal_class(&ce TSRMLS_CC); php_phongo_objectid_ce->create_object = php_phongo_objectid_create_object; PHONGO_CE_FINAL(php_phongo_objectid_ce); diff --git a/src/BSON/ObjectIDInterface.c b/src/BSON/ObjectIdInterface.c similarity index 80% rename from src/BSON/ObjectIDInterface.c rename to src/BSON/ObjectIdInterface.c index f379f4abb..d50332f75 100644 --- a/src/BSON/ObjectIDInterface.c +++ b/src/BSON/ObjectIdInterface.c @@ -25,13 +25,13 @@ zend_class_entry *php_phongo_objectid_interface_ce; -/* {{{ MongoDB\BSON\ObjectIDInterface function entries */ -ZEND_BEGIN_ARG_INFO_EX(ai_ObjectIDInterface_void, 0, 0, 0) +/* {{{ MongoDB\BSON\ObjectIdInterface function entries */ +ZEND_BEGIN_ARG_INFO_EX(ai_ObjectIdInterface_void, 0, 0, 0) ZEND_END_ARG_INFO() static zend_function_entry php_phongo_objectid_interface_me[] = { - ZEND_ABSTRACT_ME(ObjectIDInterface, getTimestamp, ai_ObjectIDInterface_void) - ZEND_ABSTRACT_ME(ObjectIDInterface, __toString, ai_ObjectIDInterface_void) + ZEND_ABSTRACT_ME(ObjectIdInterface, getTimestamp, ai_ObjectIdInterface_void) + ZEND_ABSTRACT_ME(ObjectIdInterface, __toString, ai_ObjectIdInterface_void) PHP_FE_END }; /* }}} */ @@ -40,7 +40,7 @@ void php_phongo_objectid_interface_init_ce(INIT_FUNC_ARGS) /* {{{ */ { zend_class_entry ce; - INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectIDInterface", php_phongo_objectid_interface_me); + INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "ObjectIdInterface", php_phongo_objectid_interface_me); php_phongo_objectid_interface_ce = zend_register_internal_interface(&ce TSRMLS_CC); } /* }}} */ diff --git a/src/MongoDB/BulkWrite.c b/src/MongoDB/BulkWrite.c index 3c6bb9624..f93680b3e 100644 --- a/src/MongoDB/BulkWrite.c +++ b/src/MongoDB/BulkWrite.c @@ -246,12 +246,12 @@ static PHP_METHOD(BulkWrite, insert) /* If the insert document appears to be a legacy index, instruct libmongoc * to allow dots in BSON keys by setting the "legacyIndex" option. * - * Note: php_phongo_zval_to_bson() may have added an ObjectID if the "_id" + * Note: php_phongo_zval_to_bson() may have added an ObjectId if the "_id" * field was unset. We don't know at this point if the insert is destined * for a pre-2.6 server's "system.indexes" collection, but legacy index * creation will ignore the "_id" so there is no harm in leaving it. In the * event php_phongo_bulkwrite_insert_is_legacy_index() returns a false - * positive, we absolutely want ObjectID added if "_id" was unset. */ + * positive, we absolutely want ObjectId added if "_id" was unset. */ if (php_phongo_bulkwrite_insert_is_legacy_index(&bdocument) && !BSON_APPEND_BOOL(&boptions, "legacyIndex", true)) { phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Error appending \"legacyIndex\" option"); diff --git a/src/MongoDB/Cursor.c b/src/MongoDB/Cursor.c index c93ad8329..49cb25c78 100644 --- a/src/MongoDB/Cursor.c +++ b/src/MongoDB/Cursor.c @@ -270,7 +270,7 @@ static PHP_METHOD(Cursor, toArray) } } /* }}} */ -/* {{{ proto MongoDB\Driver\CursorID MongoDB\Driver\Cursor::getId() +/* {{{ proto MongoDB\Driver\CursorId MongoDB\Driver\Cursor::getId() Returns the CursorId for this cursor */ static PHP_METHOD(Cursor, getId) { diff --git a/src/MongoDB/CursorID.c b/src/MongoDB/CursorId.c similarity index 88% rename from src/MongoDB/CursorID.c rename to src/MongoDB/CursorId.c index 930b26f4d..0b49b8334 100644 --- a/src/MongoDB/CursorID.c +++ b/src/MongoDB/CursorId.c @@ -26,9 +26,9 @@ zend_class_entry *php_phongo_cursorid_ce; -/* {{{ proto string MongoDB\Driver\CursorID::__toString() - Returns the string representation of the CursorID */ -static PHP_METHOD(CursorID, __toString) +/* {{{ proto string MongoDB\Driver\CursorId::__toString() + Returns the string representation of the CursorId */ +static PHP_METHOD(CursorId, __toString) { php_phongo_cursorid_t *intern; char *tmp; @@ -46,19 +46,19 @@ static PHP_METHOD(CursorID, __toString) efree(tmp); } /* }}} */ -/* {{{ MongoDB\Driver\CursorID function entries */ -ZEND_BEGIN_ARG_INFO_EX(ai_CursorID_void, 0, 0, 0) +/* {{{ MongoDB\Driver\CursorId function entries */ +ZEND_BEGIN_ARG_INFO_EX(ai_CursorId_void, 0, 0, 0) ZEND_END_ARG_INFO() static zend_function_entry php_phongo_cursorid_me[] = { - PHP_ME(CursorID, __toString, ai_CursorID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - ZEND_NAMED_ME(__construct, PHP_FN(MongoDB_disabled___construct), ai_CursorID_void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_NAMED_ME(__wakeup, PHP_FN(MongoDB_disabled___wakeup), ai_CursorID_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(CursorId, __toString, ai_CursorId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + ZEND_NAMED_ME(__construct, PHP_FN(MongoDB_disabled___construct), ai_CursorId_void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) + ZEND_NAMED_ME(__wakeup, PHP_FN(MongoDB_disabled___wakeup), ai_CursorId_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; /* }}} */ -/* {{{ MongoDB\Driver\CursorID object handlers */ +/* {{{ MongoDB\Driver\CursorId object handlers */ static zend_object_handlers php_phongo_handler_cursorid; static void php_phongo_cursorid_free_object(phongo_free_object_arg *object TSRMLS_DC) /* {{{ */ @@ -131,7 +131,7 @@ void php_phongo_cursorid_init_ce(INIT_FUNC_ARGS) /* {{{ */ { zend_class_entry ce; - INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "CursorID", php_phongo_cursorid_me); + INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "CursorId", php_phongo_cursorid_me); php_phongo_cursorid_ce = zend_register_internal_class(&ce TSRMLS_CC); php_phongo_cursorid_ce->create_object = php_phongo_cursorid_create_object; PHONGO_CE_FINAL(php_phongo_cursorid_ce); diff --git a/src/bson-encode.c b/src/bson-encode.c index c85be2459..5f22d67c8 100644 --- a/src/bson-encode.c +++ b/src/bson-encode.c @@ -207,7 +207,7 @@ static void php_phongo_bson_append_object(bson_t *bson, php_phongo_bson_flags_t bson_oid_t oid; php_phongo_objectid_t *intern = Z_OBJECTID_OBJ_P(object); - mongoc_log(MONGOC_LOG_LEVEL_TRACE, MONGOC_LOG_DOMAIN, "encoding ObjectID"); + mongoc_log(MONGOC_LOG_LEVEL_TRACE, MONGOC_LOG_DOMAIN, "encoding ObjectId"); bson_oid_init_from_string(&oid, intern->oid); bson_append_oid(bson, key, key_len, &oid); return; diff --git a/tests/apm/overview.phpt b/tests/apm/overview.phpt index 8ca3c36bd..d510eb086 100644 --- a/tests/apm/overview.phpt +++ b/tests/apm/overview.phpt @@ -113,7 +113,7 @@ object(MongoDB\Driver\Monitoring\CommandStartedEvent)#%d (%d) { ["decimal"]=> int(12345678) ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } @@ -198,7 +198,7 @@ array(%d) { [0]=> object(stdClass)#%d (%d) { ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } diff --git a/tests/bson-corpus/oid-decodeError-001.phpt b/tests/bson-corpus/oid-decodeError-001.phpt index 563be3a8d..dece6e6d6 100644 --- a/tests/bson-corpus/oid-decodeError-001.phpt +++ b/tests/bson-corpus/oid-decodeError-001.phpt @@ -1,5 +1,5 @@ --TEST-- -ObjectID: OID truncated +ObjectId: OID truncated --DESCRIPTION-- Generated by scripts/convert-bson-corpus-tests.php diff --git a/tests/bson-corpus/oid-valid-001.phpt b/tests/bson-corpus/oid-valid-001.phpt index 31d3c7c65..dbd33e45a 100644 --- a/tests/bson-corpus/oid-valid-001.phpt +++ b/tests/bson-corpus/oid-valid-001.phpt @@ -1,5 +1,5 @@ --TEST-- -ObjectID: All zeroes +ObjectId: All zeroes --DESCRIPTION-- Generated by scripts/convert-bson-corpus-tests.php diff --git a/tests/bson-corpus/oid-valid-002.phpt b/tests/bson-corpus/oid-valid-002.phpt index fc65d25ac..47d7407e9 100644 --- a/tests/bson-corpus/oid-valid-002.phpt +++ b/tests/bson-corpus/oid-valid-002.phpt @@ -1,5 +1,5 @@ --TEST-- -ObjectID: All ones +ObjectId: All ones --DESCRIPTION-- Generated by scripts/convert-bson-corpus-tests.php diff --git a/tests/bson-corpus/oid-valid-003.phpt b/tests/bson-corpus/oid-valid-003.phpt index ef783bc71..95a51655f 100644 --- a/tests/bson-corpus/oid-valid-003.phpt +++ b/tests/bson-corpus/oid-valid-003.phpt @@ -1,5 +1,5 @@ --TEST-- -ObjectID: Random +ObjectId: Random --DESCRIPTION-- Generated by scripts/convert-bson-corpus-tests.php diff --git a/tests/bson/bson-fromPHP_error-003.phpt b/tests/bson/bson-fromPHP_error-003.phpt index d1195e275..7fa443bc9 100644 --- a/tests/bson/bson-fromPHP_error-003.phpt +++ b/tests/bson/bson-fromPHP_error-003.phpt @@ -15,7 +15,7 @@ $tests = array( new MongoDB\BSON\Javascript('function foo(bar) {var baz = bar; var bar = foo; return bar; }'), new MongoDB\BSON\MinKey, new MongoDB\BSON\MaxKey, - new MongoDB\BSON\ObjectID, + new MongoDB\BSON\ObjectId, new MongoDB\BSON\Regex('regexp', 'i'), new MongoDB\BSON\Timestamp(1234, 5678), new MongoDB\BSON\UTCDateTime('1416445411987'), @@ -41,7 +41,7 @@ MongoDB\BSON\Type instance MongoDB\BSON\MinKey cannot be serialized as a root el OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\Type instance MongoDB\BSON\MaxKey cannot be serialized as a root element OK: Got MongoDB\Driver\Exception\UnexpectedValueException -MongoDB\BSON\Type instance MongoDB\BSON\ObjectID cannot be serialized as a root element +MongoDB\BSON\Type instance MongoDB\BSON\ObjectId cannot be serialized as a root element OK: Got MongoDB\Driver\Exception\UnexpectedValueException MongoDB\BSON\Type instance MongoDB\BSON\Regex cannot be serialized as a root element OK: Got MongoDB\Driver\Exception\UnexpectedValueException diff --git a/tests/bson/bson-generate-document-id.phpt b/tests/bson/bson-generate-document-id.phpt index bc2f1ee18..355056644 100644 --- a/tests/bson/bson-generate-document-id.phpt +++ b/tests/bson/bson-generate-document-id.phpt @@ -46,7 +46,7 @@ array(3) { string(8) "New York" } ["_id"]=> - object(%s\ObjectID)#%d (%d) { + object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } @@ -55,7 +55,7 @@ array(3) { Dumping fetched user document: object(stdClass)#%d (3) { ["_id"]=> - object(%s\ObjectID)#%d (%d) { + object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } diff --git a/tests/bson/bson-javascript-002.phpt b/tests/bson/bson-javascript-002.phpt index fd8b3aee0..99f81ddec 100644 --- a/tests/bson/bson-javascript-002.phpt +++ b/tests/bson/bson-javascript-002.phpt @@ -14,7 +14,7 @@ $tests = array( ), array( 'function foo() { return id; }', - array('id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')), + array('id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')), ), ); @@ -51,7 +51,7 @@ object(MongoDB\BSON\Javascript)#%d (%d) { ["scope"]=> object(stdClass)#%d (%d) { ["id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } diff --git a/tests/bson/bson-javascript-getCode-001.phpt b/tests/bson/bson-javascript-getCode-001.phpt index 1541af665..f18ae6553 100644 --- a/tests/bson/bson-javascript-getCode-001.phpt +++ b/tests/bson/bson-javascript-getCode-001.phpt @@ -7,7 +7,7 @@ $tests = [ ['function foo(bar) { return bar; }', null], ['function foo(bar) { return bar; }', []], ['function foo() { return foo; }', ['foo' => 42]], - ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')]], + ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')]], ]; foreach ($tests as $test) { diff --git a/tests/bson/bson-javascript-getScope-001.phpt b/tests/bson/bson-javascript-getScope-001.phpt index 71b309e83..7b13ca52e 100644 --- a/tests/bson/bson-javascript-getScope-001.phpt +++ b/tests/bson/bson-javascript-getScope-001.phpt @@ -7,7 +7,7 @@ $tests = [ ['function foo(bar) { return bar; }', null], ['function foo(bar) { return bar; }', []], ['function foo() { return foo; }', ['foo' => 42]], - ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')]], + ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')]], ]; foreach ($tests as $test) { @@ -30,7 +30,7 @@ object(stdClass)#%d (%d) { } object(stdClass)#%d (%d) { ["id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } diff --git a/tests/bson/bson-javascript-serialization-001.phpt b/tests/bson/bson-javascript-serialization-001.phpt index dcecee716..8d6dc442e 100644 --- a/tests/bson/bson-javascript-serialization-001.phpt +++ b/tests/bson/bson-javascript-serialization-001.phpt @@ -7,7 +7,7 @@ $tests = [ ['function foo(bar) { return bar; }', null], ['function foo(bar) { return bar; }', []], ['function foo() { return foo; }', ['foo' => 42]], - ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')]], + ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')]], ]; foreach ($tests as $test) { @@ -79,20 +79,20 @@ object(MongoDB\BSON\Javascript)#%d (%d) { ["scope"]=> object(stdClass)#%d (%d) { ["id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } } } -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";}}}}}" +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";}}}}}" object(MongoDB\BSON\Javascript)#%d (%d) { ["code"]=> string(29) "function foo() { return id; }" ["scope"]=> object(stdClass)#%d (%d) { ["id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } diff --git a/tests/bson/bson-javascript-set_state-001.phpt b/tests/bson/bson-javascript-set_state-001.phpt index 13bf8e7f6..7701e4ee1 100644 --- a/tests/bson/bson-javascript-set_state-001.phpt +++ b/tests/bson/bson-javascript-set_state-001.phpt @@ -7,7 +7,7 @@ $tests = [ ['function foo(bar) { return bar; }', null], ['function foo(bar) { return bar; }', []], ['function foo() { return foo; }', ['foo' => 42]], - ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')]], + ['function foo() { return id; }', ['id' => new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')]], ]; foreach ($tests as $test) { @@ -55,7 +55,7 @@ MongoDB\BSON\Javascript::__set_state(array( %w'scope' => stdClass::__set_state(array( %w'id' => - MongoDB\BSON\ObjectID::__set_state(array( + MongoDB\BSON\ObjectId::__set_state(array( %w'oid' => '53e2a1c40640fd72175d4603', )), )), diff --git a/tests/bson/bson-objectid-001.phpt b/tests/bson/bson-objectid-001.phpt index e62364187..7c979e8d2 100644 --- a/tests/bson/bson-objectid-001.phpt +++ b/tests/bson/bson-objectid-001.phpt @@ -1,26 +1,26 @@ --TEST-- -MongoDB\BSON\ObjectID #001 +MongoDB\BSON\ObjectId #001 --FILE-- my = $sameid; $samearr = array("my" => $sameid); $std = new stdclass; -$std->_id = new MongoDB\BSON\ObjectID; +$std->_id = new MongoDB\BSON\ObjectId; $array = array( - "_id" => new MongoDB\BSON\ObjectID, - "id" => new MongoDB\BSON\ObjectID, - "d" => new MongoDB\BSON\ObjectID, + "_id" => new MongoDB\BSON\ObjectId, + "id" => new MongoDB\BSON\ObjectId, + "d" => new MongoDB\BSON\ObjectId, ); -$pregenerated = new MongoDB\BSON\ObjectID("53e28b650640fd3162152de1"); +$pregenerated = new MongoDB\BSON\ObjectId("53e28b650640fd3162152de1"); $tests = array( $array, @@ -40,19 +40,19 @@ foreach($tests as $n => $test) { } throws(function() { - $id = new MongoDB\BSON\ObjectID("53e28b650640fd3162152de12"); + $id = new MongoDB\BSON\ObjectId("53e28b650640fd3162152de12"); }, "MongoDB\\Driver\\Exception\\InvalidArgumentException"); throws(function() { - $id = new MongoDB\BSON\ObjectID("53e28b650640fd3162152dg1"); + $id = new MongoDB\BSON\ObjectId("53e28b650640fd3162152dg1"); }, "MongoDB\\Driver\\Exception\\InvalidArgumentException"); throws(function() { - $id = new MongoDB\BSON\ObjectID("-3e28b650640fd3162152da1"); + $id = new MongoDB\BSON\ObjectId("-3e28b650640fd3162152da1"); }, "MongoDB\\Driver\\Exception\\InvalidArgumentException"); throws(function() { - $id = new MongoDB\BSON\ObjectID(" 3e28b650640fd3162152da1"); + $id = new MongoDB\BSON\ObjectId(" 3e28b650640fd3162152da1"); }, "MongoDB\\Driver\\Exception\\InvalidArgumentException"); diff --git a/tests/bson/bson-objectid-002.phpt b/tests/bson/bson-objectid-002.phpt index 6d0b124e3..9b8a4edfb 100644 --- a/tests/bson/bson-objectid-002.phpt +++ b/tests/bson/bson-objectid-002.phpt @@ -1,20 +1,20 @@ --TEST-- -MongoDB\BSON\ObjectID #002 generates ObjectID for null or missing constructor argument +MongoDB\BSON\ObjectId #002 generates ObjectId for null or missing constructor argument --FILE-- ===DONE=== --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/bson/bson-objectid-003.phpt b/tests/bson/bson-objectid-003.phpt index fbeb2ad2a..831130787 100644 --- a/tests/bson/bson-objectid-003.phpt +++ b/tests/bson/bson-objectid-003.phpt @@ -1,5 +1,5 @@ --TEST-- -MongoDB\BSON\ObjectID #003 construction with string argument +MongoDB\BSON\ObjectId #003 construction with string argument --FILE-- ===DONE=== --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "53e2a1c40640fd72175d4603" } diff --git a/tests/bson/bson-objectid-004.phpt b/tests/bson/bson-objectid-004.phpt index ccf76e01d..c29d5f34b 100644 --- a/tests/bson/bson-objectid-004.phpt +++ b/tests/bson/bson-objectid-004.phpt @@ -1,15 +1,15 @@ --TEST-- -MongoDB\BSON\ObjectID #004 Constructor supports uppercase hexadecimal strings +MongoDB\BSON\ObjectId #004 Constructor supports uppercase hexadecimal strings --FILE-- ===DONE=== --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "56925b7330616224d0000001" } diff --git a/tests/bson/bson-objectid-compare-001.phpt b/tests/bson/bson-objectid-compare-001.phpt index fc6c1d0a8..c9a542246 100644 --- a/tests/bson/bson-objectid-compare-001.phpt +++ b/tests/bson/bson-objectid-compare-001.phpt @@ -1,14 +1,14 @@ --TEST-- -MongoDB\BSON\ObjectID comparisons +MongoDB\BSON\ObjectId comparisons --FILE-- new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603') == new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603')); -var_dump(new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4604')); -var_dump(new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectID('53e2a1c40640fd72175d4602')); +var_dump(new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4604')); +var_dump(new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectId('53e2a1c40640fd72175d4602')); ?> ===DONE=== diff --git a/tests/bson/bson-objectid-compare-002.phpt b/tests/bson/bson-objectid-compare-002.phpt index ae34e260f..eb0b87a96 100644 --- a/tests/bson/bson-objectid-compare-002.phpt +++ b/tests/bson/bson-objectid-compare-002.phpt @@ -1,14 +1,14 @@ --TEST-- -MongoDB\BSON\ObjectID comparisons with null bytes +MongoDB\BSON\ObjectId comparisons with null bytes --FILE-- new MongoDB\BSON\ObjectID('00e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603') == new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603')); +var_dump(new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603')); -var_dump(new MongoDB\BSON\ObjectID('00e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectID('00e2a1c40640fd72175d4604')); -var_dump(new MongoDB\BSON\ObjectID('00e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectID('00e2a1c40640fd72175d4602')); +var_dump(new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603') < new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4604')); +var_dump(new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4603') > new MongoDB\BSON\ObjectId('00e2a1c40640fd72175d4602')); ?> ===DONE=== diff --git a/tests/bson/bson-objectid-getTimestamp-001.phpt b/tests/bson/bson-objectid-getTimestamp-001.phpt index 24d32a35d..462e276a5 100644 --- a/tests/bson/bson-objectid-getTimestamp-001.phpt +++ b/tests/bson/bson-objectid-getTimestamp-001.phpt @@ -1,10 +1,10 @@ --TEST-- -MongoDB\BSON\ObjectID::getTimestamp +MongoDB\BSON\ObjectId::getTimestamp --FILE-- getTimestamp(); echo $ts, "\n"; echo date_create( "@{$ts}" )->format( "Y-m-d H:i:s" ), "\n"; diff --git a/tests/bson/bson-objectid-jsonserialize-001.phpt b/tests/bson/bson-objectid-jsonserialize-001.phpt index b5cc1322a..d8aa98f3b 100644 --- a/tests/bson/bson-objectid-jsonserialize-001.phpt +++ b/tests/bson/bson-objectid-jsonserialize-001.phpt @@ -1,9 +1,9 @@ --TEST-- -MongoDB\BSON\ObjectID::jsonSerialize() return value +MongoDB\BSON\ObjectId::jsonSerialize() return value --FILE-- jsonSerialize()); ?> diff --git a/tests/bson/bson-objectid-jsonserialize-002.phpt b/tests/bson/bson-objectid-jsonserialize-002.phpt index fb6a9af3e..91504cdc7 100644 --- a/tests/bson/bson-objectid-jsonserialize-002.phpt +++ b/tests/bson/bson-objectid-jsonserialize-002.phpt @@ -1,11 +1,11 @@ --TEST-- -MongoDB\BSON\ObjectID::jsonSerialize() with json_encode() +MongoDB\BSON\ObjectId::jsonSerialize() with json_encode() --FILE-- new MongoDB\BSON\ObjectID('5820ca4bef62d52d9924d0d8')]; +$doc = ['foo' => new MongoDB\BSON\ObjectId('5820ca4bef62d52d9924d0d8')]; $json = json_encode($doc); echo toJSON(fromPHP($doc)), "\n"; @@ -20,7 +20,7 @@ var_dump(toPHP(fromJSON($json))); {"foo":{"$oid":"5820ca4bef62d52d9924d0d8"}} object(stdClass)#%d (%d) { ["foo"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "5820ca4bef62d52d9924d0d8" } diff --git a/tests/bson/bson-objectid-serialization-001.phpt b/tests/bson/bson-objectid-serialization-001.phpt index d75afea02..5403ab138 100644 --- a/tests/bson/bson-objectid-serialization-001.phpt +++ b/tests/bson/bson-objectid-serialization-001.phpt @@ -1,9 +1,9 @@ --TEST-- -MongoDB\BSON\ObjectID serialization +MongoDB\BSON\ObjectId serialization --FILE-- --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "576c25db6118fd406e6e6471" } -string(82) "C:21:"MongoDB\BSON\ObjectID":48:{a:1:{s:3:"oid";s:24:"576c25db6118fd406e6e6471";}}" -object(MongoDB\BSON\ObjectID)#%d (%d) { +string(82) "C:21:"MongoDB\BSON\ObjectId":48:{a:1:{s:3:"oid";s:24:"576c25db6118fd406e6e6471";}}" +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "576c25db6118fd406e6e6471" } diff --git a/tests/bson/bson-objectid-serialization_error-001.phpt b/tests/bson/bson-objectid-serialization_error-001.phpt index 08362bed9..e1154300c 100644 --- a/tests/bson/bson-objectid-serialization_error-001.phpt +++ b/tests/bson/bson-objectid-serialization_error-001.phpt @@ -1,12 +1,12 @@ --TEST-- -MongoDB\BSON\ObjectID unserialization requires "oid" string field +MongoDB\BSON\ObjectId unserialization requires "oid" string field --FILE-- @@ -14,5 +14,5 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -MongoDB\BSON\ObjectID initialization requires "oid" string field +MongoDB\BSON\ObjectId initialization requires "oid" string field ===DONE=== diff --git a/tests/bson/bson-objectid-serialization_error-002.phpt b/tests/bson/bson-objectid-serialization_error-002.phpt index 236de6f52..a6d9cb624 100644 --- a/tests/bson/bson-objectid-serialization_error-002.phpt +++ b/tests/bson/bson-objectid-serialization_error-002.phpt @@ -1,16 +1,16 @@ --TEST-- -MongoDB\BSON\ObjectID unserialization requires valid hex string +MongoDB\BSON\ObjectId unserialization requires valid hex string --FILE-- @@ -18,7 +18,7 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: 0123456789abcdefghijklmn +Error parsing ObjectId string: 0123456789abcdefghijklmn OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: INVALID +Error parsing ObjectId string: INVALID ===DONE=== diff --git a/tests/bson/bson-objectid-set_state-001.phpt b/tests/bson/bson-objectid-set_state-001.phpt index 7e5d37b19..8d77ecfd0 100644 --- a/tests/bson/bson-objectid-set_state-001.phpt +++ b/tests/bson/bson-objectid-set_state-001.phpt @@ -1,9 +1,9 @@ --TEST-- -MongoDB\BSON\ObjectID::__set_state() +MongoDB\BSON\ObjectId::__set_state() --FILE-- '576c25db6118fd406e6e6471', ])); echo "\n"; @@ -12,7 +12,7 @@ echo "\n"; ===DONE=== --EXPECTF-- -MongoDB\BSON\ObjectID::__set_state(array( +MongoDB\BSON\ObjectId::__set_state(array( %w'oid' => '576c25db6118fd406e6e6471', )) ===DONE=== diff --git a/tests/bson/bson-objectid-set_state_error-001.phpt b/tests/bson/bson-objectid-set_state_error-001.phpt index 844acdff8..ba35dcce7 100644 --- a/tests/bson/bson-objectid-set_state_error-001.phpt +++ b/tests/bson/bson-objectid-set_state_error-001.phpt @@ -1,12 +1,12 @@ --TEST-- -MongoDB\BSON\ObjectID::__set_state() requires "oid" string field +MongoDB\BSON\ObjectId::__set_state() requires "oid" string field --FILE-- 0]); + MongoDB\BSON\ObjectId::__set_state(['oid' => 0]); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; ?> @@ -14,5 +14,5 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -MongoDB\BSON\ObjectID initialization requires "oid" string field +MongoDB\BSON\ObjectId initialization requires "oid" string field ===DONE=== diff --git a/tests/bson/bson-objectid-set_state_error-002.phpt b/tests/bson/bson-objectid-set_state_error-002.phpt index 699e63a75..57c195b45 100644 --- a/tests/bson/bson-objectid-set_state_error-002.phpt +++ b/tests/bson/bson-objectid-set_state_error-002.phpt @@ -1,16 +1,16 @@ --TEST-- -MongoDB\BSON\ObjectID::__set_state() requires valid hex string +MongoDB\BSON\ObjectId::__set_state() requires valid hex string --FILE-- '0123456789abcdefghijklmn']); + MongoDB\BSON\ObjectId::__set_state(['oid' => '0123456789abcdefghijklmn']); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; echo throws(function() { - MongoDB\BSON\ObjectID::__set_state(['oid' => 'INVALID']); + MongoDB\BSON\ObjectId::__set_state(['oid' => 'INVALID']); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; ?> @@ -18,7 +18,7 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: 0123456789abcdefghijklmn +Error parsing ObjectId string: 0123456789abcdefghijklmn OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: INVALID +Error parsing ObjectId string: INVALID ===DONE=== diff --git a/tests/bson/bson-objectid_error-001.phpt b/tests/bson/bson-objectid_error-001.phpt index 4f0f12ef7..ae4890a0e 100644 --- a/tests/bson/bson-objectid_error-001.phpt +++ b/tests/bson/bson-objectid_error-001.phpt @@ -1,5 +1,5 @@ --TEST-- -MongoDB\BSON\ObjectID #001 error +MongoDB\BSON\ObjectId #001 error --SKIPIF-- --FILE-- @@ -8,7 +8,7 @@ MongoDB\BSON\ObjectID #001 error require_once __DIR__ . '/../utils/tools.php'; throws(function() { - new MongoDB\BSON\ObjectID(new stdclass); + new MongoDB\BSON\ObjectId(new stdclass); }, "MongoDB\\Driver\\Exception\\InvalidArgumentException"); ?> diff --git a/tests/bson/bson-objectid_error-002.phpt b/tests/bson/bson-objectid_error-002.phpt index de4e75ca4..68df9460a 100644 --- a/tests/bson/bson-objectid_error-002.phpt +++ b/tests/bson/bson-objectid_error-002.phpt @@ -1,12 +1,12 @@ --TEST-- -MongoDB\BSON\ObjectID cannot be extended +MongoDB\BSON\ObjectId cannot be extended --FILE-- ===DONE=== --EXPECTF-- -Fatal error: Class MyObjectID may not inherit from final class (MongoDB\BSON\ObjectID) in %s on line %d +Fatal error: Class MyObjectId may not inherit from final class (MongoDB\BSON\ObjectId) in %s on line %d diff --git a/tests/bson/bson-objectid_error-003.phpt b/tests/bson/bson-objectid_error-003.phpt index 15af2fca2..f07266e3a 100644 --- a/tests/bson/bson-objectid_error-003.phpt +++ b/tests/bson/bson-objectid_error-003.phpt @@ -1,16 +1,16 @@ --TEST-- -MongoDB\BSON\ObjectID::__construct() requires valid hex string +MongoDB\BSON\ObjectId::__construct() requires valid hex string --FILE-- @@ -18,7 +18,7 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: 0123456789abcdefghijklmn +Error parsing ObjectId string: 0123456789abcdefghijklmn OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Error parsing ObjectID string: INVALID +Error parsing ObjectId string: INVALID ===DONE=== diff --git a/tests/bson/bson-objectidinterface-001.phpt b/tests/bson/bson-objectidinterface-001.phpt index 6e752d682..d1a14a253 100644 --- a/tests/bson/bson-objectidinterface-001.phpt +++ b/tests/bson/bson-objectidinterface-001.phpt @@ -1,10 +1,10 @@ --TEST-- -MongoDB\BSON\ObjectIDInterface is implemented by MongoDB\BSON\ObjectID +MongoDB\BSON\ObjectIdInterface is implemented by MongoDB\BSON\ObjectId --FILE-- ===DONE=== diff --git a/tests/bson/bson-toCanonicalJSON-002.phpt b/tests/bson/bson-toCanonicalJSON-002.phpt index 2cb99f658..a618b626b 100644 --- a/tests/bson/bson-toCanonicalJSON-002.phpt +++ b/tests/bson/bson-toCanonicalJSON-002.phpt @@ -6,7 +6,7 @@ MongoDB\BSON\toCanonicalExtendedJSON(): Encoding extended JSON types require_once __DIR__ . '/../utils/tools.php'; $tests = [ - [ '_id' => new MongoDB\BSON\ObjectID('56315a7c6118fd1b920270b1') ], + [ '_id' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], diff --git a/tests/bson/bson-toJSON-002.phpt b/tests/bson/bson-toJSON-002.phpt index 542ce9b84..137f78e23 100644 --- a/tests/bson/bson-toJSON-002.phpt +++ b/tests/bson/bson-toJSON-002.phpt @@ -6,7 +6,7 @@ MongoDB\BSON\toJSON(): Encoding extended JSON types require_once __DIR__ . '/../utils/tools.php'; $tests = [ - [ '_id' => new MongoDB\BSON\ObjectID('56315a7c6118fd1b920270b1') ], + [ '_id' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], diff --git a/tests/bson/bson-toPHP-004.phpt b/tests/bson/bson-toPHP-004.phpt index 3d9de6b00..c62180d9f 100644 --- a/tests/bson/bson-toPHP-004.phpt +++ b/tests/bson/bson-toPHP-004.phpt @@ -26,7 +26,7 @@ $tests = [ new MongoDB\BSON\Javascript('function(){}'), new MongoDB\BSON\MaxKey, new MongoDB\BSON\MinKey, - new MongoDB\BSON\ObjectID('586c18d86118fd6c9012dec1'), + new MongoDB\BSON\ObjectId('586c18d86118fd6c9012dec1'), new MongoDB\BSON\Regex('foo'), new MongoDB\BSON\Timestamp(1234, 5678), new MongoDB\BSON\UTCDateTime('1483479256924'), @@ -422,12 +422,12 @@ object(stdClass)#%d (1) { } } -Testing MongoDB\BSON\ObjectID visitor function +Testing MongoDB\BSON\ObjectId visitor function object(stdClass)#%d (1) { ["x"]=> array(1) { [0]=> - object(MongoDB\BSON\ObjectID)#%d (1) { + object(MongoDB\BSON\ObjectId)#%d (1) { ["oid"]=> string(24) "586c18d86118fd6c9012dec1" } @@ -437,7 +437,7 @@ object(stdClass)#%d (1) { ["x"]=> object(stdClass)#%d (1) { [0]=> - object(MongoDB\BSON\ObjectID)#%d (1) { + object(MongoDB\BSON\ObjectId)#%d (1) { ["oid"]=> string(24) "586c18d86118fd6c9012dec1" } @@ -449,7 +449,7 @@ object(stdClass)#%d (1) { ["storage":"ArrayObject":private]=> array(1) { [0]=> - object(MongoDB\BSON\ObjectID)#%d (1) { + object(MongoDB\BSON\ObjectId)#%d (1) { ["oid"]=> string(24) "586c18d86118fd6c9012dec1" } diff --git a/tests/bson/bson-toRelaxedJSON-002.phpt b/tests/bson/bson-toRelaxedJSON-002.phpt index ffcb38aeb..25c26f622 100644 --- a/tests/bson/bson-toRelaxedJSON-002.phpt +++ b/tests/bson/bson-toRelaxedJSON-002.phpt @@ -6,7 +6,7 @@ MongoDB\BSON\toRelaxedExtendedJSON(): Encoding extended JSON types require_once __DIR__ . '/../utils/tools.php'; $tests = [ - [ '_id' => new MongoDB\BSON\ObjectID('56315a7c6118fd1b920270b1') ], + [ '_id' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], diff --git a/tests/bson/bug0672.phpt b/tests/bson/bug0672.phpt index b7606a567..b6312b4a8 100644 --- a/tests/bson/bug0672.phpt +++ b/tests/bson/bug0672.phpt @@ -1,17 +1,17 @@ --TEST-- -PHPC-672: ObjectID constructor should not modify string argument's memory +PHPC-672: ObjectId constructor should not modify string argument's memory --FILE-- --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "56925b7330616224d0000001" } diff --git a/tests/bson/bug0894-001.phpt b/tests/bson/bug0894-001.phpt index ae48d6b28..f7a55f172 100644 --- a/tests/bson/bug0894-001.phpt +++ b/tests/bson/bug0894-001.phpt @@ -9,7 +9,7 @@ $objects = [ new MongoDB\BSON\Javascript('function foo() { return bar; }', ['bar' => 42]), new MongoDB\BSON\MaxKey, new MongoDB\BSON\MinKey, - new MongoDB\BSON\ObjectID, + new MongoDB\BSON\ObjectId, new MongoDB\BSON\Regex('foo', 'i'), new MongoDB\BSON\Timestamp(1234, 5678), new MongoDB\BSON\UTCDateTime, diff --git a/tests/bson/bug0939-001.phpt b/tests/bson/bug0939-001.phpt index 15e5833b5..667028d3a 100644 --- a/tests/bson/bug0939-001.phpt +++ b/tests/bson/bug0939-001.phpt @@ -9,7 +9,7 @@ $tests = [ [ new MongoDB\BSON\Javascript('function foo() { return bar; }', ['bar' => 42]), ['code', 'scope'] ], [ new MongoDB\BSON\MaxKey, [] ], [ new MongoDB\BSON\MinKey, [] ], - [ new MongoDB\BSON\ObjectID, ['oid'] ], + [ new MongoDB\BSON\ObjectId, ['oid'] ], [ new MongoDB\BSON\Regex('foo', 'i'), ['pattern', 'flags'] ], [ new MongoDB\BSON\Timestamp(1234, 5678), ['increment', 'timestamp'] ], [ new MongoDB\BSON\UTCDateTime, ['milliseconds'] ], @@ -74,12 +74,12 @@ object(MongoDB\BSON\MaxKey)#%d (%d) { object(MongoDB\BSON\MinKey)#%d (%d) { } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } -Notice: Undefined property: MongoDB\BSON\ObjectID::$oid in %s on line %d +Notice: Undefined property: MongoDB\BSON\ObjectId::$oid in %s on line %d NULL object(MongoDB\BSON\Regex)#%d (%d) { diff --git a/tests/bson/bug0974-001.phpt b/tests/bson/bug0974-001.phpt index 8b3122ae5..2a9bf92ab 100644 --- a/tests/bson/bug0974-001.phpt +++ b/tests/bson/bug0974-001.phpt @@ -24,7 +24,7 @@ object(stdClass)#%d (%d) { ["myArray"]=> array(1) { [0]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "201700601301102102609060" } @@ -45,7 +45,7 @@ object(stdClass)#%d (%d) { } object(stdClass)#3 (2) { [0]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "55f2b3f1f657b3fa97c9c0a2" } diff --git a/tests/bulk/bug0667.phpt b/tests/bulk/bug0667.phpt index 207e6a485..7d3175288 100644 --- a/tests/bulk/bug0667.phpt +++ b/tests/bulk/bug0667.phpt @@ -1,5 +1,5 @@ --TEST-- -PHPC-667: BulkWrite::insert() does not generate ObjectID if another field has "_id" prefix +PHPC-667: BulkWrite::insert() does not generate ObjectId if another field has "_id" prefix --SKIPIF-- --FILE-- @@ -14,11 +14,11 @@ var_dump($bulk->insert((object) ['_ids' => 1])); ===DONE=== --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/bulk/bulkwrite-insert-003.phpt b/tests/bulk/bulkwrite-insert-003.phpt index e8042018a..84ec6f570 100644 --- a/tests/bulk/bulkwrite-insert-003.phpt +++ b/tests/bulk/bulkwrite-insert-003.phpt @@ -38,7 +38,7 @@ array(1) { [0]=> object(stdClass)#%d (%d) { ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/bulk/bulkwrite-insert-004.phpt b/tests/bulk/bulkwrite-insert-004.phpt index 061fa3c95..d01d31718 100644 --- a/tests/bulk/bulkwrite-insert-004.phpt +++ b/tests/bulk/bulkwrite-insert-004.phpt @@ -32,7 +32,7 @@ class MyPersistableId extends MySerializableId implements MongoDB\BSON\Persistab $documents = [ ['x' => 1], - ['_id' => new MongoDB\BSON\ObjectID('590b72d606e9660190656a55')], + ['_id' => new MongoDB\BSON\ObjectId('590b72d606e9660190656a55')], ['_id' => ['foo' => 1]], ['_id' => new MySerializableId('foo')], ['_id' => new MyPersistableId('bar')], @@ -56,11 +56,11 @@ var_dump($cursor->toArray()); ===DONE=== --EXPECTF-- -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } -object(MongoDB\BSON\ObjectID)#%d (%d) { +object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "590b72d606e9660190656a55" } @@ -81,7 +81,7 @@ array(5) { [0]=> object(stdClass)#%d (%d) { ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } @@ -91,7 +91,7 @@ array(5) { [1]=> object(stdClass)#%d (%d) { ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "590b72d606e9660190656a55" } diff --git a/tests/cursorid/cursorid_error-001.phpt b/tests/cursorid/cursorid_error-001.phpt index c133dd1aa..53f6c31a9 100644 --- a/tests/cursorid/cursorid_error-001.phpt +++ b/tests/cursorid/cursorid_error-001.phpt @@ -1,12 +1,12 @@ --TEST-- -MongoDB\Driver\CursorID cannot be extended +MongoDB\Driver\CursorId cannot be extended --FILE-- ===DONE=== --EXPECTF-- -Fatal error: Class MyCursorID may not inherit from final class (MongoDB\Driver\CursorID) in %s on line %d +Fatal error: Class MyCursorId may not inherit from final class (MongoDB\Driver\CursorId) in %s on line %d diff --git a/tests/functional/cursorid-001.phpt b/tests/functional/cursorid-001.phpt index 6bb58a049..926d5afac 100644 --- a/tests/functional/cursorid-001.phpt +++ b/tests/functional/cursorid-001.phpt @@ -30,7 +30,7 @@ var_dump($s1 > 0); ===DONE=== --EXPECTF-- -object(MongoDB\Driver\CursorID)#%d (%d) { +object(MongoDB\Driver\CursorId)#%d (%d) { ["id"]=> %rint\(\d+\)|string\(\d+\) "\d+"%r } diff --git a/tests/manager/manager-ctor_error-003.phpt b/tests/manager/manager-ctor_error-003.phpt index 6cc9a0ce7..d71e78d9f 100644 --- a/tests/manager/manager-ctor_error-003.phpt +++ b/tests/manager/manager-ctor_error-003.phpt @@ -26,7 +26,7 @@ $invalidIntegerValues = [ true, 1.0, 'string', - new MongoDB\BSON\ObjectID, + new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ['x' => 1], ]; @@ -55,7 +55,7 @@ $invalidStringValues = [ true, 1.0, 42, - new MongoDB\BSON\ObjectID, + new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ['x' => 1], ]; @@ -75,7 +75,7 @@ $invalidDocumentValues = [ 1.0, 42, 'string', - new MongoDB\BSON\ObjectID, + new MongoDB\BSON\ObjectId, [ 1, 2, 3 ], ]; @@ -97,7 +97,7 @@ Expected 32-bit integer for "connectTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "connectTimeoutMS" URI option, ObjectID given +Expected 32-bit integer for "connectTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "connectTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -109,7 +109,7 @@ Expected 32-bit integer for "heartbeatFrequencyMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "heartbeatFrequencyMS" URI option, ObjectID given +Expected 32-bit integer for "heartbeatFrequencyMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "heartbeatFrequencyMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -121,7 +121,7 @@ Expected 32-bit integer for "localThresholdMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "localThresholdMS" URI option, ObjectID given +Expected 32-bit integer for "localThresholdMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "localThresholdMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -133,7 +133,7 @@ Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, ObjectID given +Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "serverSelectionTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -145,7 +145,7 @@ Expected 32-bit integer for "socketCheckIntervalMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "socketCheckIntervalMS" URI option, ObjectID given +Expected 32-bit integer for "socketCheckIntervalMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketCheckIntervalMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -157,7 +157,7 @@ Expected 32-bit integer for "socketTimeoutMS" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected 32-bit integer for "socketTimeoutMS" URI option, ObjectID given +Expected 32-bit integer for "socketTimeoutMS" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected 32-bit integer for "socketTimeoutMS" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -171,7 +171,7 @@ Expected string for "appname" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "appname" URI option, ObjectID given +Expected string for "appname" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "appname" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -183,7 +183,7 @@ Expected string for "authMechanism" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "authMechanism" URI option, ObjectID given +Expected string for "authMechanism" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authMechanism" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -195,7 +195,7 @@ Expected string for "authSource" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "authSource" URI option, ObjectID given +Expected string for "authSource" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "authSource" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -207,7 +207,7 @@ Expected string for "gssapiServiceName" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "gssapiServiceName" URI option, ObjectID given +Expected string for "gssapiServiceName" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "gssapiServiceName" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -219,7 +219,7 @@ Expected string for "password" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "password" URI option, ObjectID given +Expected string for "password" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "password" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -231,7 +231,7 @@ Expected string for "replicaSet" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "replicaSet" URI option, ObjectID given +Expected string for "replicaSet" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "replicaSet" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -243,7 +243,7 @@ Expected string for "username" URI option, double given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, 32-bit integer given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected string for "username" URI option, ObjectID given +Expected string for "username" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected string for "username" URI option, array given OK: Got MongoDB\Driver\Exception\InvalidArgumentException @@ -259,7 +259,7 @@ Expected array or object for "authMechanismProperties" URI option, 32-bit intege OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Expected array or object for "authMechanismProperties" URI option, ObjectID given +Expected array or object for "authMechanismProperties" URI option, ObjectId given OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected array or object for "authMechanismProperties" URI option, array given ===DONE=== diff --git a/tests/manager/manager-executeBulkWrite-002.phpt b/tests/manager/manager-executeBulkWrite-002.phpt index e21404d34..1e3a47173 100644 --- a/tests/manager/manager-executeBulkWrite-002.phpt +++ b/tests/manager/manager-executeBulkWrite-002.phpt @@ -34,11 +34,11 @@ matchedCount: 1 modifiedCount: 1 upsertedCount: 2 deletedCount: 0 -upsertedId[0]: object(%s\ObjectID)#%d (%d) { +upsertedId[0]: object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } -upsertedId[1]: object(%s\ObjectID)#%d (%d) { +upsertedId[1]: object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } @@ -48,7 +48,7 @@ array(2) { [0]=> object(stdClass)#%d (3) { ["_id"]=> - object(%s\ObjectID)#%d (%d) { + object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } @@ -60,7 +60,7 @@ array(2) { [1]=> object(stdClass)#%d (3) { ["_id"]=> - object(%s\ObjectID)#%d (%d) { + object(%s\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } diff --git a/tests/replicaset/writeresult-getserver-002.phpt b/tests/replicaset/writeresult-getserver-002.phpt index acaadc8c9..7d7d82347 100644 --- a/tests/replicaset/writeresult-getserver-002.phpt +++ b/tests/replicaset/writeresult-getserver-002.phpt @@ -86,7 +86,7 @@ string(14) "192.168.112.10" int(3001) object(stdClass)#%d (2) { ["_id"]=> - object(%s\ObjectID)#%d (1) { + object(%s\ObjectId)#%d (1) { ["oid"]=> string(24) "%s" } diff --git a/tests/standalone/bug0545.phpt b/tests/standalone/bug0545.phpt index eb6156fc5..9633f9aa7 100644 --- a/tests/standalone/bug0545.phpt +++ b/tests/standalone/bug0545.phpt @@ -85,7 +85,7 @@ Inserted 1 document(s) Modified 1 document(s) object(Book)#%d (%d) { ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%s" } diff --git a/tests/writeResult/writeresult-debug-001.phpt b/tests/writeResult/writeresult-debug-001.phpt index 6cdd26fcd..a21908d68 100644 --- a/tests/writeResult/writeresult-debug-001.phpt +++ b/tests/writeResult/writeresult-debug-001.phpt @@ -42,7 +42,7 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { ["index"]=> int(2) ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } @@ -52,7 +52,7 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { ["index"]=> int(3) ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/writeResult/writeresult-debug-002.phpt b/tests/writeResult/writeresult-debug-002.phpt index 9fe56becc..f8a9a6c04 100644 --- a/tests/writeResult/writeresult-debug-002.phpt +++ b/tests/writeResult/writeresult-debug-002.phpt @@ -48,7 +48,7 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { ["index"]=> int(0) ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } @@ -58,7 +58,7 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { ["index"]=> int(1) ["_id"]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/writeResult/writeresult-getupsertedids-001.phpt b/tests/writeResult/writeresult-getupsertedids-001.phpt index e597debb1..ff961d76c 100644 --- a/tests/writeResult/writeresult-getupsertedids-001.phpt +++ b/tests/writeResult/writeresult-getupsertedids-001.phpt @@ -26,12 +26,12 @@ var_dump($result->getUpsertedIds()); --EXPECTF-- array(2) { [2]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } [3]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "%x" } diff --git a/tests/writeResult/writeresult-getupsertedids-002.phpt b/tests/writeResult/writeresult-getupsertedids-002.phpt index 8e59f3297..5bd57d96b 100644 --- a/tests/writeResult/writeresult-getupsertedids-002.phpt +++ b/tests/writeResult/writeresult-getupsertedids-002.phpt @@ -11,7 +11,7 @@ require_once __DIR__ . "/../utils/basic.inc"; * * Do not test array or Regex types, which are not permitted to be used as an * ID. If a regular expression is used in upsert criteria and does not match an - * existing document, the server generates a new ObjectID. */ + * existing document, the server generates a new ObjectId. */ $tests = [ null, true, @@ -23,7 +23,7 @@ $tests = [ new MongoDB\BSON\Javascript('function(){}'), new MongoDB\BSON\MaxKey, new MongoDB\BSON\MinKey, - new MongoDB\BSON\ObjectID('586c18d86118fd6c9012dec1'), + new MongoDB\BSON\ObjectId('586c18d86118fd6c9012dec1'), new MongoDB\BSON\Timestamp(1234, 5678), new MongoDB\BSON\UTCDateTime('1483479256924'), ]; @@ -79,7 +79,7 @@ array(13) { object(MongoDB\BSON\MinKey)#%d (%d) { } [10]=> - object(MongoDB\BSON\ObjectID)#%d (%d) { + object(MongoDB\BSON\ObjectId)#%d (%d) { ["oid"]=> string(24) "586c18d86118fd6c9012dec1" }