diff --git a/php_phongo.c b/php_phongo.c index 39522c050..2a4c3d8d5 100644 --- a/php_phongo.c +++ b/php_phongo.c @@ -931,8 +931,6 @@ void php_phongo_read_concern_to_zval(zval *retval, const mongoc_read_concern_t * if (level) { ADD_ASSOC_STRING(retval, "level", (char *)level); - } else { - ADD_ASSOC_NULL_EX(retval, "level"); } } /* }}} */ @@ -962,12 +960,21 @@ bool php_phongo_read_preference_tags_are_valid(const bson_t *tags) /* {{{ */ void php_phongo_read_preference_to_zval(zval *retval, const mongoc_read_prefs_t *read_prefs) /* {{{ */ { const bson_t *tags = mongoc_read_prefs_get_tags(read_prefs); + mongoc_read_mode_t mode = mongoc_read_prefs_get_mode(read_prefs); array_init_size(retval, 2); - ADD_ASSOC_LONG_EX(retval, "mode", mongoc_read_prefs_get_mode(read_prefs)); + switch (mode) { + case MONGOC_READ_PRIMARY: ADD_ASSOC_STRING(retval, "mode", "primary"); break; + case MONGOC_READ_PRIMARY_PREFERRED: ADD_ASSOC_STRING(retval, "mode", "primaryPreferred"); break; + case MONGOC_READ_SECONDARY: ADD_ASSOC_STRING(retval, "mode", "secondary"); break; + case MONGOC_READ_SECONDARY_PREFERRED: ADD_ASSOC_STRING(retval, "mode", "secondaryPreferred"); break; + case MONGOC_READ_NEAREST: ADD_ASSOC_STRING(retval, "mode", "nearest"); break; + default: /* Do nothing */ + break; + } - if (tags->len) { + if (!bson_empty0(tags)) { php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER; /* Use native arrays for debugging output */ state.map.root_type = PHONGO_TYPEMAP_NATIVE_ARRAY; @@ -979,8 +986,6 @@ void php_phongo_read_preference_to_zval(zval *retval, const mongoc_read_prefs_t #else ADD_ASSOC_ZVAL_EX(retval, "tags", state.zchild); #endif - } else { - ADD_ASSOC_NULL_EX(retval, "tags"); } } /* }}} */ @@ -988,6 +993,7 @@ void php_phongo_write_concern_to_zval(zval *retval, const mongoc_write_concern_t { const char *wtag = mongoc_write_concern_get_wtag(write_concern); const int32_t w = mongoc_write_concern_get_w(write_concern); + const int32_t wtimeout = mongoc_write_concern_get_wtimeout(write_concern); array_init_size(retval, 4); @@ -997,17 +1003,14 @@ void php_phongo_write_concern_to_zval(zval *retval, const mongoc_write_concern_t ADD_ASSOC_STRING(retval, "w", (char *)PHONGO_WRITE_CONCERN_W_MAJORITY); } else if (w != MONGOC_WRITE_CONCERN_W_DEFAULT) { ADD_ASSOC_LONG_EX(retval, "w", w); - } else { - ADD_ASSOC_NULL_EX(retval, "w"); } - ADD_ASSOC_BOOL_EX(retval, "wmajority", mongoc_write_concern_get_wmajority(write_concern)); - ADD_ASSOC_LONG_EX(retval, "wtimeout", mongoc_write_concern_get_wtimeout(write_concern)); - if (mongoc_write_concern_journal_is_set(write_concern)) { - ADD_ASSOC_BOOL_EX(retval, "journal", mongoc_write_concern_get_journal(write_concern)); - } else { - ADD_ASSOC_NULL_EX(retval, "journal"); + ADD_ASSOC_BOOL_EX(retval, "j", mongoc_write_concern_get_journal(write_concern)); + } + + if (wtimeout != 0) { + ADD_ASSOC_LONG_EX(retval, "wtimeout", wtimeout); } } /* }}} */ /* }}} */ @@ -2105,6 +2108,20 @@ PHP_MINIT_FUNCTION(mongodb) PHP_MINIT(bson)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Type)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Serializable)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Unserializable)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Persistable)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Binary)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Decimal128)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Javascript)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(MaxKey)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(MinKey)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(ObjectID)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Regex)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Timestamp)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(UTCDateTime)(INIT_FUNC_ARGS_PASSTHRU); + PHP_MINIT(Command)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(Cursor)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(CursorId)(INIT_FUNC_ARGS_PASSTHRU); @@ -2132,20 +2149,6 @@ PHP_MINIT_FUNCTION(mongodb) PHP_MINIT(ExecutionTimeoutException)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(ConnectionTimeoutException)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Type)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Serializable)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Unserializable)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Persistable)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Binary)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Decimal128)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Javascript)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(MaxKey)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(MinKey)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(ObjectID)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Regex)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(Timestamp)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(UTCDateTime)(INIT_FUNC_ARGS_PASSTHRU); - REGISTER_STRING_CONSTANT("MONGODB_VERSION", (char *)MONGODB_VERSION_S, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("MONGODB_STABILITY", (char *)MONGODB_STABILITY_S, CONST_CS | CONST_PERSISTENT); diff --git a/src/MongoDB/ReadConcern.c b/src/MongoDB/ReadConcern.c index f723d051d..5ffcc7600 100644 --- a/src/MongoDB/ReadConcern.c +++ b/src/MongoDB/ReadConcern.c @@ -101,6 +101,20 @@ PHP_METHOD(ReadConcern, getLevel) } /* }}} */ +/* {{{ proto array ReadConcern::bsonSerialize() + */ +PHP_METHOD(ReadConcern, bsonSerialize) +{ + const mongoc_read_concern_t *read_concern = phongo_read_concern_from_zval(getThis() TSRMLS_CC); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + php_phongo_read_concern_to_zval(return_value, read_concern); +} +/* }}} */ + /** * Value object for read concern used in issuing read operations. */ @@ -116,7 +130,7 @@ ZEND_END_ARG_INFO() static zend_function_entry php_phongo_readconcern_me[] = { PHP_ME(ReadConcern, __construct, ai_ReadConcern___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(ReadConcern, getLevel, ai_ReadConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Manager, __wakeup, ai_ReadConcern_void, ZEND_ACC_PUBLIC) + PHP_ME(ReadConcern, bsonSerialize, ai_ReadConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; @@ -192,6 +206,8 @@ PHP_MINIT_FUNCTION(ReadConcern) PHONGO_CE_FINAL(php_phongo_readconcern_ce); PHONGO_CE_DISABLE_SERIALIZATION(php_phongo_readconcern_ce); + zend_class_implements(php_phongo_readconcern_ce TSRMLS_CC, 1, php_phongo_serializable_ce); + memcpy(&php_phongo_handler_readconcern, phongo_get_std_object_handlers(), sizeof(zend_object_handlers)); php_phongo_handler_readconcern.get_debug_info = php_phongo_readconcern_get_debug_info; #if PHP_VERSION_ID >= 70000 diff --git a/src/MongoDB/ReadPreference.c b/src/MongoDB/ReadPreference.c index 4e2a01111..4996ccd01 100644 --- a/src/MongoDB/ReadPreference.c +++ b/src/MongoDB/ReadPreference.c @@ -162,6 +162,20 @@ PHP_METHOD(ReadPreference, getTagSets) } /* }}} */ +/* {{{ proto array ReadPreference::bsonSerialize() + */ +PHP_METHOD(ReadPreference, bsonSerialize) +{ + const mongoc_read_prefs_t *read_preference = phongo_read_preference_from_zval(getThis() TSRMLS_CC); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + php_phongo_read_preference_to_zval(return_value, read_preference); +} +/* }}} */ + /** * Value object for read preferences used in issuing commands and queries. */ @@ -179,7 +193,7 @@ static zend_function_entry php_phongo_readpreference_me[] = { PHP_ME(ReadPreference, __construct, ai_ReadPreference___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(ReadPreference, getMode, ai_ReadPreference_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(ReadPreference, getTagSets, ai_ReadPreference_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Manager, __wakeup, ai_ReadPreference_void, ZEND_ACC_PUBLIC) + PHP_ME(ReadPreference, bsonSerialize, ai_ReadPreference_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; @@ -258,6 +272,8 @@ PHP_MINIT_FUNCTION(ReadPreference) PHONGO_CE_FINAL(php_phongo_readpreference_ce); PHONGO_CE_DISABLE_SERIALIZATION(php_phongo_readpreference_ce); + zend_class_implements(php_phongo_readpreference_ce TSRMLS_CC, 1, php_phongo_serializable_ce); + memcpy(&php_phongo_handler_readpreference, phongo_get_std_object_handlers(), sizeof(zend_object_handlers)); php_phongo_handler_readpreference.get_debug_info = php_phongo_readpreference_get_debug_info; #if PHP_VERSION_ID >= 70000 diff --git a/src/MongoDB/WriteConcern.c b/src/MongoDB/WriteConcern.c index c0d66496d..62c2bcf2e 100644 --- a/src/MongoDB/WriteConcern.c +++ b/src/MongoDB/WriteConcern.c @@ -182,6 +182,20 @@ PHP_METHOD(WriteConcern, getJournal) } /* }}} */ +/* {{{ proto array WriteConcern::bsonSerialize() + */ +PHP_METHOD(WriteConcern, bsonSerialize) +{ + const mongoc_write_concern_t *write_concern = phongo_write_concern_from_zval(getThis() TSRMLS_CC); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + php_phongo_write_concern_to_zval(return_value, write_concern); +} +/* }}} */ + /** * Value object for write concern used in issuing write operations. */ @@ -201,7 +215,7 @@ static zend_function_entry php_phongo_writeconcern_me[] = { PHP_ME(WriteConcern, getW, ai_WriteConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(WriteConcern, getWtimeout, ai_WriteConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(WriteConcern, getJournal, ai_WriteConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Manager, __wakeup, ai_WriteConcern_void, ZEND_ACC_PUBLIC) + PHP_ME(WriteConcern, bsonSerialize, ai_WriteConcern_void, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_FE_END }; @@ -277,6 +291,8 @@ PHP_MINIT_FUNCTION(WriteConcern) PHONGO_CE_FINAL(php_phongo_writeconcern_ce); PHONGO_CE_DISABLE_SERIALIZATION(php_phongo_writeconcern_ce); + zend_class_implements(php_phongo_writeconcern_ce TSRMLS_CC, 1, php_phongo_serializable_ce); + memcpy(&php_phongo_handler_writeconcern, phongo_get_std_object_handlers(), sizeof(zend_object_handlers)); php_phongo_handler_writeconcern.get_debug_info = php_phongo_writeconcern_get_debug_info; #if PHP_VERSION_ID >= 70000 diff --git a/tests/bulk/write-0002.phpt b/tests/bulk/write-0002.phpt index d5c46087d..ddef45fcb 100644 --- a/tests/bulk/write-0002.phpt +++ b/tests/bulk/write-0002.phpt @@ -67,12 +67,8 @@ object(MongoDB\Driver\BulkWrite)#%d (%d) { array(%d) { ["w"]=> int(1) - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(1000) - ["journal"]=> - NULL } } Inserted 2 documents to %s diff --git a/tests/manager/manager-getreadconcern-001.phpt b/tests/manager/manager-getreadconcern-001.phpt index f987bef4b..6a1308656 100644 --- a/tests/manager/manager-getreadconcern-001.phpt +++ b/tests/manager/manager-getreadconcern-001.phpt @@ -32,8 +32,6 @@ foreach ($tests as $i => $test) { --EXPECTF-- object(MongoDB\Driver\ReadConcern)#%d (%d) { - ["level"]=> - NULL } object(MongoDB\Driver\ReadConcern)#%d (%d) { ["level"]=> diff --git a/tests/manager/manager-getreadpreference-001.phpt b/tests/manager/manager-getreadpreference-001.phpt index 137921ab0..4297d20f1 100644 --- a/tests/manager/manager-getreadpreference-001.phpt +++ b/tests/manager/manager-getreadpreference-001.phpt @@ -32,35 +32,23 @@ foreach ($tests as $i => $test) { --EXPECTF-- object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(1) - ["tags"]=> - array(0) { - } + string(7) "primary" } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) - ["tags"]=> - array(0) { - } + string(9) "secondary" } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(5) - ["tags"]=> - array(0) { - } + string(16) "primaryPreferred" } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(6) - ["tags"]=> - array(0) { - } + string(18) "secondaryPreferred" } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) + string(9) "secondary" ["tags"]=> array(2) { [0]=> @@ -77,7 +65,7 @@ object(MongoDB\Driver\ReadPreference)#%d (%d) { } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) + string(9) "secondary" ["tags"]=> array(2) { [0]=> @@ -94,7 +82,7 @@ object(MongoDB\Driver\ReadPreference)#%d (%d) { } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) + string(9) "secondary" ["tags"]=> array(1) { [0]=> diff --git a/tests/manager/manager-getwriteconcern-001.phpt b/tests/manager/manager-getwriteconcern-001.phpt index 1b1ead8aa..4bb6e612b 100644 --- a/tests/manager/manager-getwriteconcern-001.phpt +++ b/tests/manager/manager-getwriteconcern-001.phpt @@ -36,113 +36,53 @@ foreach ($tests as $i => $test) { --EXPECTF-- object(MongoDB\Driver\WriteConcern)#%d (%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(1) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> - bool(true) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(1) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> + ["j"]=> bool(true) } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> - bool(true) - ["wtimeout"]=> - int(0) - ["journal"]=> + ["j"]=> bool(true) } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(1) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> + ["j"]=> bool(false) } object(MongoDB\Driver\WriteConcern)#%d (%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(2) - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(1000) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> - bool(true) ["wtimeout"]=> int(1000) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(12) "customTagSet" - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(1000) - ["journal"]=> - NULL } ===DONE=== diff --git a/tests/readConcern/readconcern-ctor-001.phpt b/tests/readConcern/readconcern-ctor-001.phpt index d58c33ae9..7263516d4 100644 --- a/tests/readConcern/readconcern-ctor-001.phpt +++ b/tests/readConcern/readconcern-ctor-001.phpt @@ -17,12 +17,8 @@ var_dump(new MongoDB\Driver\ReadConcern('not-yet-supported')); --EXPECTF-- object(MongoDB\Driver\ReadConcern)#%d (%d) { - ["level"]=> - NULL } object(MongoDB\Driver\ReadConcern)#%d (%d) { - ["level"]=> - NULL } object(MongoDB\Driver\ReadConcern)#%d (%d) { ["level"]=> diff --git a/tests/readPreference/bug0146-002.phpt b/tests/readPreference/bug0146-002.phpt index 45e433074..aaa18954c 100644 --- a/tests/readPreference/bug0146-002.phpt +++ b/tests/readPreference/bug0146-002.phpt @@ -63,10 +63,7 @@ object(MongoDB\Driver\Cursor)#%d (%d) { ["readPreference"]=> object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(1) - ["tags"]=> - array(0) { - } + string(7) "primary" } ["isDead"]=> bool(false) @@ -112,10 +109,7 @@ object(MongoDB\Driver\Cursor)#%d (%d) { ["readPreference"]=> object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(5) - ["tags"]=> - array(0) { - } + string(16) "primaryPreferred" } ["isDead"]=> bool(false) @@ -161,10 +155,7 @@ object(MongoDB\Driver\Cursor)#%d (%d) { ["readPreference"]=> object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) - ["tags"]=> - array(0) { - } + string(9) "secondary" } ["isDead"]=> bool(false) @@ -210,10 +201,7 @@ object(MongoDB\Driver\Cursor)#%d (%d) { ["readPreference"]=> object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(6) - ["tags"]=> - array(0) { - } + string(18) "secondaryPreferred" } ["isDead"]=> bool(false) @@ -259,10 +247,7 @@ object(MongoDB\Driver\Cursor)#%d (%d) { ["readPreference"]=> object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(10) - ["tags"]=> - array(0) { - } + string(7) "nearest" } ["isDead"]=> bool(false) diff --git a/tests/readPreference/readpreference-ctor-001.phpt b/tests/readPreference/readpreference-ctor-001.phpt index f766eba1d..3990442a7 100644 --- a/tests/readPreference/readpreference-ctor-001.phpt +++ b/tests/readPreference/readpreference-ctor-001.phpt @@ -16,14 +16,11 @@ var_dump(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRI --EXPECTF-- object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(1) - ["tags"]=> - array(0) { - } + string(7) "primary" } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(2) + string(9) "secondary" ["tags"]=> array(1) { [0]=> @@ -35,9 +32,6 @@ object(MongoDB\Driver\ReadPreference)#%d (%d) { } object(MongoDB\Driver\ReadPreference)#%d (%d) { ["mode"]=> - int(1) - ["tags"]=> - array(0) { - } + string(7) "primary" } ===DONE=== diff --git a/tests/server/server-executeBulkWrite-001.phpt b/tests/server/server-executeBulkWrite-001.phpt index 54070b128..247effc96 100644 --- a/tests/server/server-executeBulkWrite-001.phpt +++ b/tests/server/server-executeBulkWrite-001.phpt @@ -70,14 +70,6 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { NULL ["writeConcern"]=> array(%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } } diff --git a/tests/standalone/writeresult-isacknowledged-001.phpt b/tests/standalone/writeresult-isacknowledged-001.phpt index 050b694e8..64214a6bc 100644 --- a/tests/standalone/writeresult-isacknowledged-001.phpt +++ b/tests/standalone/writeresult-isacknowledged-001.phpt @@ -41,14 +41,6 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { NULL ["writeConcern"]=> array(%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } } ===DONE=== diff --git a/tests/standalone/writeresult-isacknowledged-002.phpt b/tests/standalone/writeresult-isacknowledged-002.phpt index f975a9706..5943f833d 100644 --- a/tests/standalone/writeresult-isacknowledged-002.phpt +++ b/tests/standalone/writeresult-isacknowledged-002.phpt @@ -45,12 +45,6 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { array(%d) { ["w"]=> int(0) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } } ===DONE=== diff --git a/tests/standalone/writeresult-isacknowledged-003.phpt b/tests/standalone/writeresult-isacknowledged-003.phpt index 9356bce68..7918dcb5a 100644 --- a/tests/standalone/writeresult-isacknowledged-003.phpt +++ b/tests/standalone/writeresult-isacknowledged-003.phpt @@ -43,12 +43,6 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { array(%d) { ["w"]=> int(0) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } } ===DONE=== diff --git a/tests/writeConcern/writeconcern-ctor-001.phpt b/tests/writeConcern/writeconcern-ctor-001.phpt index 8c25e22e8..c06c93a88 100644 --- a/tests/writeConcern/writeconcern-ctor-001.phpt +++ b/tests/writeConcern/writeconcern-ctor-001.phpt @@ -26,91 +26,53 @@ var_dump(new MongoDB\Driver\WriteConcern("string", 6000, null)); object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> - bool(true) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> - bool(true) ["wtimeout"]=> int(1000) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(2) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(2) - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(2000) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(7) "tagname" - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(6) "string" - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(3000) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(6) "string" - ["wmajority"]=> - bool(false) + ["j"]=> + bool(true) ["wtimeout"]=> int(4000) - ["journal"]=> - bool(true) } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(6) "string" - ["wmajority"]=> + ["j"]=> bool(false) ["wtimeout"]=> int(5000) - ["journal"]=> - bool(false) } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(6) "string" - ["wmajority"]=> - bool(false) ["wtimeout"]=> int(6000) - ["journal"]=> - NULL } ===DONE=== diff --git a/tests/writeConcern/writeconcern-debug-001.phpt b/tests/writeConcern/writeconcern-debug-001.phpt index 598eedc11..cea8019ce 100644 --- a/tests/writeConcern/writeconcern-debug-001.phpt +++ b/tests/writeConcern/writeconcern-debug-001.phpt @@ -17,13 +17,9 @@ var_dump(new MongoDB\Driver\WriteConcern(-2, 1000, true)); --EXPECTF-- object(MongoDB\Driver\WriteConcern)#%d (%d) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) + ["j"]=> + bool(true) ["wtimeout"]=> int(1000) - ["journal"]=> - bool(true) } ===DONE=== diff --git a/tests/writeConcern/writeconcern-debug-002.phpt b/tests/writeConcern/writeconcern-debug-002.phpt index f33f0971f..610940c3b 100644 --- a/tests/writeConcern/writeconcern-debug-002.phpt +++ b/tests/writeConcern/writeconcern-debug-002.phpt @@ -17,31 +17,21 @@ var_dump(new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> int(1) - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(3) "tag" - ["wmajority"]=> + ["j"]=> bool(false) ["wtimeout"]=> int(1000) - ["journal"]=> - bool(false) } object(MongoDB\Driver\WriteConcern)#%d (%d) { ["w"]=> string(8) "majority" - ["wmajority"]=> + ["j"]=> bool(true) ["wtimeout"]=> int(500) - ["journal"]=> - bool(true) } ===DONE=== diff --git a/tests/writeResult/writeresult-debug-001.phpt b/tests/writeResult/writeresult-debug-001.phpt index 59501238f..f11814e57 100644 --- a/tests/writeResult/writeresult-debug-001.phpt +++ b/tests/writeResult/writeresult-debug-001.phpt @@ -63,15 +63,7 @@ object(MongoDB\Driver\WriteResult)#%d (%d) { ["writeConcernError"]=> NULL ["writeConcern"]=> - array(4) { - ["w"]=> - NULL - ["wmajority"]=> - bool(false) - ["wtimeout"]=> - int(0) - ["journal"]=> - NULL + array(%d) { } } ===DONE===