Skip to content

PHPC-1004: Rename ObjectID to ObjectId #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion php_phongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion serialization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
60 changes: 30 additions & 30 deletions src/BSON/ObjectID.c → src/BSON/ObjectId.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} /* }}} */
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) /* {{{ */
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/BSON/ObjectIDInterface.c → src/BSON/ObjectIdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
/* }}} */
Expand All @@ -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);
} /* }}} */

Expand Down
4 changes: 2 additions & 2 deletions src/MongoDB/BulkWrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/MongoDB/Cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
20 changes: 10 additions & 10 deletions src/MongoDB/CursorID.c → src/MongoDB/CursorId.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) /* {{{ */
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/bson-encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/apm/overview.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion tests/bson-corpus/oid-decodeError-001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ObjectID: OID truncated
ObjectId: OID truncated
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

Expand Down
2 changes: 1 addition & 1 deletion tests/bson-corpus/oid-valid-001.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ObjectID: All zeroes
ObjectId: All zeroes
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

Expand Down
2 changes: 1 addition & 1 deletion tests/bson-corpus/oid-valid-002.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ObjectID: All ones
ObjectId: All ones
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

Expand Down
2 changes: 1 addition & 1 deletion tests/bson-corpus/oid-valid-003.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
ObjectID: Random
ObjectId: Random
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

Expand Down
4 changes: 2 additions & 2 deletions tests/bson/bson-fromPHP_error-003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/bson/bson-generate-document-id.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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"
}
Expand Down
Loading