PATH:
opt
/
alt
/
tests
/
alt-php54-pecl-mongodb_1.2.11-1.el8
/
tests
--TEST-- MongoDB\Driver\Server::executeQuery() takes a read preference (OP_QUERY) --SKIPIF-- <?php require __DIR__ . "/../utils/basic-skipif.inc"; ?> <?php NEEDS('REPLICASET_30'); CLEANUP(REPLICASET_30, DATABASE_NAME, 'system.profile'); ?> --FILE-- <?php require_once __DIR__ . "/../utils/basic.inc"; $manager = new MongoDB\Driver\Manager(REPLICASET_30); $rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY); $secondary = $manager->selectServer($rp); $command = new MongoDB\Driver\Command(array('profile' => 2)); $cursor = $secondary->executeCommand(DATABASE_NAME, $command); $result = current($cursor->toArray()); printf("Set profile level to 2 successfully: %s\n", (empty($result->ok) ? 'no' : 'yes')); if (empty($result->ok)) { exit("Could not set profile level\n"); } $secondary->executeQuery(NS, new MongoDB\Driver\Query(array("x" => 1)), $rp); $query = new MongoDB\Driver\Query( array( 'op' => 'query', 'ns' => NS, ), array( 'sort' => array('ts' => -1), 'limit' => 1, ) ); $cursor = $secondary->executeQuery(DATABASE_NAME . '.system.profile', $query, $rp); $profileEntry = current($cursor->toArray()); var_dump($profileEntry->query); $command = new MongoDB\Driver\Command(array('profile' => 0)); $cursor = $secondary->executeCommand(DATABASE_NAME, $command); $result = current($cursor->toArray()); printf("Set profile level to 0 successfully: %s\n", (empty($result->ok) ? 'no' : 'yes')); ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- Set profile level to 2 successfully: yes object(stdClass)#%d (%d) { ["x"]=> int(1) } Set profile level to 0 successfully: yes ===DONE===
[+]
..
[-] bson-toPHP-002.phpt
[edit]
[-] bson-utcdatetime-006.phpt
[edit]
[-] bulkwrite-delete-001.phpt
[edit]
[-] manager-executeBulkWrite-009.phpt
[edit]
[-] bson-utcdatetime_error-004.phpt
[edit]
[-] command-aggregate-001.phpt
[edit]
[-] bson-objectid-001.phpt
[edit]
[-] bson-decimal128-serialization_error-002.phpt
[edit]
[-] bson-utcdatetime-001.phpt
[edit]
[-] bson-javascript-001.phpt
[edit]
[-] bson-javascript-jsonserialize-002.phpt
[edit]
[-] bson-utcdatetime-serialization_error-001.phpt
[edit]
[-] bson-utcdatetime_error-001.phpt
[edit]
[-] bson-objectid-002.phpt
[edit]
[-] bson-toPHP_error-002.phpt
[edit]
[-] server-debug.phpt
[edit]
[-] bson-fromPHP-005.phpt
[edit]
[-] bson-regex-jsonserialize-003.phpt
[edit]
[-] write-0001.phpt
[edit]
[-] manager-executeBulkWrite_error-003.phpt
[edit]
[-] bson-fromJSON-001.phpt
[edit]
[-] writeconcern-debug-003.phpt
[edit]
[-] bson-utcdatetime-set_state-002.phpt
[edit]
[-] bug0334-001.phpt
[edit]
[-] bson-decimal128-serialization_error-001.phpt
[edit]
[-] bson-timestamp-set_state_error-003.phpt
[edit]
[-] manager-getservers-002.phpt
[edit]
[-] manager-wakeup.phpt
[edit]
[-] bson-regex_error-003.phpt
[edit]
[-] bson-utcdatetime-tostring-001.phpt
[edit]
[-] bson-objectid-jsonserialize-002.phpt
[edit]
[-] server-constants.phpt
[edit]
[-] bson-toJSON_error-003.phpt
[edit]
[-] bson-decode-002.phpt
[edit]
[-] readpreference-getMaxStalenessMS-001.phpt
[edit]
[-] bug0341.phpt
[edit]
[-] bug0274.phpt
[edit]
[-] bson-encode-004.phpt
[edit]
[-] bson-javascript-jsonserialize-003.phpt
[edit]
[-] bson-encode-005.phpt
[edit]
[-] manager-ctor-read_preference-001.phpt
[edit]
[-] bson-encode-002.phpt
[edit]
[-] bson-timestamp-set_state-001.phpt
[edit]
[-] standalone-x509-extract_username-001.phpt
[edit]
[-] bson-binary_error-002.phpt
[edit]
[-] bulkwrite-update-001.phpt
[edit]
[-] writeconcern-ctor_error-004.phpt
[edit]
[-] server-executeQuery-004.phpt
[edit]
[-] bulkwrite-debug-001.phpt
[edit]
[-] bson-minkey-set_state-001.phpt
[edit]
[-] readpreference-ctor_error-004.phpt
[edit]
[-] bson-timestamp_error-001.phpt
[edit]
[-] bson-utcdatetime-int-size-002.phpt
[edit]
[-] bson-javascript-jsonserialize-004.phpt
[edit]
[-] writeconcern-getjournal-001.phpt
[edit]
[-] bson-decimal128-serialization-001.phpt
[edit]
[-] bson-javascript-set_state_error-002.phpt
[edit]
[-] bson-regex-002.phpt
[edit]
[-] query-sort-001.phpt
[edit]
[-] server-executeQuery-003.phpt
[edit]
[-] manager-executeBulkWrite-002.phpt
[edit]
[-] manager-executeBulkWrite-004.phpt
[edit]
[-] bson-fromPHP_error-004.phpt
[edit]
[-] writeresult-isacknowledged-003.phpt
[edit]
[-] bson-regex-serialization-001.phpt
[edit]
[-] writeconcern-ctor-001.phpt
[edit]
[-] typemap-001.phpt
[edit]
[-] manager-ctor_error-001.phpt
[edit]
[-] bug0923-002.phpt
[edit]
[-] bug0940-002.phpt
[edit]
[-] bson-regex-serialization-002.phpt
[edit]
[-] manager-ctor-appname-001.phpt
[edit]
[-] bulkwrite_error-002.phpt
[edit]
[-] manager-executeBulkWrite-001.phpt
[edit]
[-] bson-objectid_error-003.phpt
[edit]
[-] bson-javascript-serialization_error-003.phpt
[edit]
[-] bson-fromPHP_error-005.phpt
[edit]
[-] bson-decimal128-002.phpt
[edit]
[-] bug0334-002.phpt
[edit]
[-] readpreference-getMode-001.phpt
[edit]
[-] bug0313.phpt
[edit]
[-] bson-decimal128-004.phpt
[edit]
[-] bson-binary_error-003.phpt
[edit]
[-] server-errors.phpt
[edit]
[-] bson-encode-003.phpt
[edit]
[-] bson-utcdatetime-serialization-001.phpt
[edit]
[-] writeconcern-ctor_error-003.phpt
[edit]
[-] bson-fromPHP-001.phpt
[edit]
[-] standalone-auth-0002.phpt
[edit]
[-] bson-javascript-tostring-001.phpt
[edit]
[-] bson-utcdatetime-jsonserialize-001.phpt
[edit]
[-] manager-set-uri-options-001.phpt
[edit]
[-] bug0592.phpt
[edit]
[-] query-sort-004.phpt
[edit]
[-] bug0655.phpt
[edit]
[-] manager-ctor-read_preference-002.phpt
[edit]
[-] manager-getservers-001.phpt
[edit]
[-] manager-executeBulkWrite-005.phpt
[edit]
[-] manager-executeBulkWrite-006.phpt
[edit]
[-] manager-executeBulkWrite_error-004.phpt
[edit]
[-] bson-toPHP-001.phpt
[edit]
[-] server-executeQuery-001.phpt
[edit]
[-] bson-toPHP_error-003.phpt
[edit]
[-] bson-generate-document-id.phpt
[edit]
[-] bson-timestamp-005.phpt
[edit]
[-] bson-fromPHP-006.phpt
[edit]
[-] bug0347.phpt
[edit]
[-] connectiontimeoutexception-001.phpt
[edit]
[-] bug0623.phpt
[edit]
[-] bson-timestamp-set_state-002.phpt
[edit]
[-] writeconcern-ctor_error-002.phpt
[edit]
[-] bson-utcdatetime-todatetime-001.phpt
[edit]
[-] query-sort-003.phpt
[edit]
[-] bson-utcdatetime-serialization-002.phpt
[edit]
[-] bson-utcdatetime-int-size-001.phpt
[edit]
[-] manager-executeQuery-002.phpt
[edit]
[-] bson-fromPHP_error-006.phpt
[edit]
[-] bson-timestamp_error-006.phpt
[edit]
[-] writeconcern-ctor_error-001.phpt
[edit]
[-] bson-regex-003.phpt
[edit]
[-] bson-binary-serialization_error-002.phpt
[edit]
[-] bson-decode-001.phpt
[edit]
[-] bson-javascript-compare-002.phpt
[edit]
[-] bug0146-001.phpt
[edit]
[-] bson-utcdatetime-007.phpt
[edit]
[-] bug0851-001.phpt
[edit]
[-] bson-toJSON_error-002.phpt
[edit]
[-] manager-ctor-read_preference-004.phpt
[edit]
[-] bson-timestamp-compare-001.phpt
[edit]
[-] bson-binary-serialization_error-001.phpt
[edit]
[-] bson-timestamp-serialization_error-001.phpt
[edit]
[-] bson-toPHP_error-001.phpt
[edit]
[-] writeconcern_error-001.phpt
[edit]
[-] bson-minkey_error-001.phpt
[edit]
[-] manager-destruct-001.phpt
[edit]
[-] server-executeQuery-008.phpt
[edit]
[-] bson-timestamp-serialization-001.phpt
[edit]
[-] bson-binary-jsonserialize-002.phpt
[edit]
[-] manager-executeBulkWrite-008.phpt
[edit]
[-] bson-encode-001.phpt
[edit]
[-] manager-invalidnamespace.phpt
[edit]
[-] bson-javascript-serialization_error-001.phpt
[edit]
[-] bson-objectid-serialization-001.phpt
[edit]
[-] bulkwrite-count-001.phpt
[edit]
[-] manager-executeBulkWrite-011.phpt
[edit]
[-] bson-javascript-002.phpt
[edit]
[-] bug0545.phpt
[edit]
[-] writeconcern-bsonserialize-001.phpt
[edit]
[-] manager_error-001.phpt
[edit]
[-] bson-regex-compare-002.phpt
[edit]
[-] bug0357.phpt
[edit]
[-] bson-decimal128-set_state_error-001.phpt
[edit]
[-] server-executeBulkWrite-002.phpt
[edit]
[-] manager-ctor-read_preference-error-002.phpt
[edit]
[-] server-executeCommand-003.phpt
[edit]
[-] bson-fromPHP_error-002.phpt
[edit]
[-] readpreference-ctor-001.phpt
[edit]
[-] manager-getwriteconcern-001.phpt
[edit]
[-] bug1006-001.phpt
[edit]
[-] bson-javascript-getCode-001.phpt
[edit]
[-] manager-executeBulkWrite_error-002.phpt
[edit]
[-] bson-decimal128-003.phpt
[edit]
[-] manager-executeQuery-001.phpt
[edit]
[-] bson-timestamp-set_state_error-004.phpt
[edit]
[-] bson-utcdatetime-003.phpt
[edit]
[-] bson-regex-set_state-001.phpt
[edit]
[-] bson-objectid-003.phpt
[edit]
[-] bson-regex-set_state_error-002.phpt
[edit]
[-] manager-debug-002.phpt
[edit]
[-] manager-selectserver_error-001.phpt
[edit]
[-] bson-utcdatetime_error-002.phpt
[edit]
[-] manager-ctor-003.phpt
[edit]
[-] bson-objectid-jsonserialize-001.phpt
[edit]
[-] bson-javascript-set_state_error-001.phpt
[edit]
[-] query-sort-002.phpt
[edit]
[-] bug0913-001.phpt
[edit]
[-] manager-var-dump-001.phpt
[edit]
[-] bug0531.phpt
[edit]
[-] bson-binary-tostring-001.phpt
[edit]
[-] bug0672.phpt
[edit]
[-] bulkwrite_error-001.phpt
[edit]
[-] manager-ctor-read_preference-003.phpt
[edit]
[-] manager-ctor-appname_error-001.phpt
[edit]
[-] bson-fromPHP-003.phpt
[edit]
[-] write-error-001.phpt
[edit]
[-] server_error-001.phpt
[edit]
[-] bson-javascript-serialization_error-002.phpt
[edit]
[-] writeresult-isacknowledged-001.phpt
[edit]
[-] bson-javascript-set_state_error-003.phpt
[edit]
[-] bug0671-002.phpt
[edit]
[-] server-executeBulkWrite-004.phpt
[edit]
[-] bson-timestamp-004.phpt
[edit]
[-] update-multi-001.phpt
[edit]
[-] bson-utcdatetime-set_state_error-002.phpt
[edit]
[-] bson-maxkey-serialization-001.phpt
[edit]
[-] bson-utcdatetime-jsonserialize-002.phpt
[edit]
[-] readpreference-bsonserialize-002.phpt
[edit]
[-] bson-javascript_error-003.phpt
[edit]
[-] manager-executeBulkWrite-007.phpt
[edit]
[-] bson-javascript-serialization-001.phpt
[edit]
[-] bson-utcdatetime-005.phpt
[edit]
[-] manager-executeBulkWrite_error-007.phpt
[edit]
[-] readpreference-ctor_error-002.phpt
[edit]
[-] bson-toJSON-002.phpt
[edit]
[-] bson-utcdatetime_error-003.phpt
[edit]
[-] bson-utcdatetime-todatetime-002.phpt
[edit]
[-] bug0166.phpt
[edit]
[-] bson-objectid-set_state_error-002.phpt
[edit]
[-] readpreference-debug-001.phpt
[edit]
[-] manager-executeQuery-005.phpt
[edit]
[-] query-errors.phpt
[edit]
[-] bson-unknown-001.phpt
[edit]
[-] bson-regex_error-001.phpt
[edit]
[-] server-executeCommand-002.phpt
[edit]
[-] manager-getreadconcern-001.phpt
[edit]
[-] bson-objectid-004.phpt
[edit]
[-] standalone-plain-0001.phpt
[edit]
[-] server-executeQuery-002.phpt
[edit]
[-] manager-selectserver-001.phpt
[edit]
[-] bson-objectid-set_state_error-001.phpt
[edit]
[-] writeconcern-debug-001.phpt
[edit]
[-] bson-maxkey-jsonserialize-002.phpt
[edit]
[-] bson-timestamp-serialization_error-002.phpt
[edit]
[-] readpreference-ctor_error-001.phpt
[edit]
[-] server-executeBulkWrite-003.phpt
[edit]
[-] phpinfo-1.phpt
[edit]
[-] bson-utcdatetime-set_state_error-001.phpt
[edit]
[-] server-executeQuery-005.phpt
[edit]
[-] bson-decimal128-jsonserialize-002.phpt
[edit]
[-] bson-fromPHP-002.phpt
[edit]
[-] bson-objectid-set_state-001.phpt
[edit]
[-] bson-javascript-compare-001.phpt
[edit]
[-] bug0912-001.phpt
[edit]
[-] bson-objectid_error-001.phpt
[edit]
[-] server-executeQuery-006.phpt
[edit]
[-] bson-objectid-serialization_error-002.phpt
[edit]
[-] writeconcern-bsonserialize-002.phpt
[edit]
[-] bson-timestamp_error-003.phpt
[edit]
[-] standalone-x509-extract_username-002.phpt
[edit]
[-] manager-getreadpreference-001.phpt
[edit]
[-] bson-maxkey_error-001.phpt
[edit]
[-] bson-utcdatetime-serialization_error-002.phpt
[edit]
[-] bulkwrite-delete_error-001.phpt
[edit]
[-] writeconcern-getw-001.phpt
[edit]
[-] bson-utcdatetime-set_state-001.phpt
[edit]
[-] bson-timestamp_error-002.phpt
[edit]
[-] executiontimeoutexception-001.phpt
[edit]
[-] bug0851-002.phpt
[edit]
[-] bulkwrite-countable-001.phpt
[edit]
[-] server-executeCommand-001.phpt
[edit]
[-] bson-decimal128-001.phpt
[edit]
[-] bug0146-002.phpt
[edit]
[-] bson-toJSON_error-001.phpt
[edit]
[-] readpreference_error-001.phpt
[edit]
[-] bson-regex-jsonserialize-004.phpt
[edit]
[-] bson-toPHP-003.phpt
[edit]
[-] bson-timestamp-serialization_error-003.phpt
[edit]
[-] bson-decimal128_error-002.phpt
[edit]
[-] bson-minkey-serialization-001.phpt
[edit]
[-] manager-executeCommand_error-001.phpt
[edit]
[-] bson-minkey-jsonserialize-001.phpt
[edit]
[-] bson-regex-serialization-003.phpt
[edit]
[-] replicaset-seedlist-002.phpt
[edit]
[-] readpreference-bsonserialize-001.phpt
[edit]
[-] cursorid-001.phpt
[edit]
[-] bug0544.phpt
[edit]
[-] bson-regex-005.phpt
[edit]
[-] bug0231.phpt
[edit]
[-] manager-as-singleton.phpt
[edit]
[-] bson-timestamp_error-005.phpt
[edit]
[-] bug0325.phpt
[edit]
[-] bson-objectid-compare-001.phpt
[edit]
[-] bulkwrite-insert-001.phpt
[edit]
[-] writeresult-isacknowledged-002.phpt
[edit]
[-] standalone-x509-error-0001.phpt
[edit]
[-] cursor-001.phpt
[edit]
[-] bson-decimal128_error-001.phpt
[edit]
[-] standalone-plain-0002.phpt
[edit]
[-] manager-executeBulkWrite_error-001.phpt
[edit]
[-] bson-timestamp-001.phpt
[edit]
[-] bson-timestamp-002.phpt
[edit]
[-] manager-ctor-001.phpt
[edit]
[-] bson-timestamp-set_state_error-002.phpt
[edit]
[-] bug0923-001.phpt
[edit]
[-] manager-executeBulkWrite-010.phpt
[edit]
[-] manager-executeCommand-001.phpt
[edit]
[-] bson-utcdatetime-compare-001.phpt
[edit]
[-] phpinfo-2.phpt
[edit]
[-] bson-timestamp-serialization-002.phpt
[edit]
[-] typemap-002.phpt
[edit]
[-] bug0159.phpt
[edit]
[-] bson-regex-set_state-002.phpt
[edit]
[-] bson-regex-serialization_error-001.phpt
[edit]
[-] bson-utcdatetime-004.phpt
[edit]
[-] writeconcern-constants.phpt
[edit]
[-] bug0528.phpt
[edit]
[-] bson-fromPHP_error-003.phpt
[edit]
[-] bug0940-001.phpt
[edit]
[-] bson-regex-004.phpt
[edit]
[-] bson-regex-compare-001.phpt
[edit]
[-] bson-regex-jsonserialize-002.phpt
[edit]
[-] manager-executeBulkWrite-003.phpt
[edit]
[-] writeconcern-debug-002.phpt
[edit]
[-] manager-ctor-002.phpt
[edit]
[-] bson-decimal128-set_state-001.phpt
[edit]
[-] executiontimeoutexception-002.phpt
[edit]
[-] bson-javascript-getScope-001.phpt
[edit]
[-] bson-maxkey-set_state-001.phpt
[edit]
[-] manager-debug-001.phpt
[edit]
[-] bug0631.phpt
[edit]
[-] server-executeBulkWrite-001.phpt
[edit]
[-] bug1006-002.phpt
[edit]
[-] server-executeBulkWrite-005.phpt
[edit]
[-] bug0667.phpt
[edit]
[-] bson-objectid_error-002.phpt
[edit]
[-] bson-maxkey-compare-001.phpt
[edit]
[-] manager-ctor-read_preference-error-001.phpt
[edit]
[-] bson-minkey-jsonserialize-002.phpt
[edit]
[-] bson-decimal128-jsonserialize-001.phpt
[edit]
[-] bug0894-001.phpt
[edit]
[-] bson-fromPHP_error-007.phpt
[edit]
[-] bson-timestamp_error-004.phpt
[edit]
[-] bson-binary_error-001.phpt
[edit]
[-] bson-regex-set_state_error-001.phpt
[edit]
[-] bson-maxkey-001.phpt
[edit]
[-] manager-ctor-write_concern-error-001.phpt
[edit]
[-] bson-javascript-jsonserialize-001.phpt
[edit]
[-] bson-regex-serialization_error-002.phpt
[edit]
[-] server-executeQuery-007.phpt
[edit]
[-] bson-objectid-serialization_error-001.phpt
[edit]
[-] write-0002.phpt
[edit]
[-] readpreference-ctor_error-003.phpt
[edit]
[-] bson-timestamp-jsonserialize-002.phpt
[edit]
[-] bson-minkey-compare-001.phpt
[edit]
[-] bson-timestamp-003.phpt
[edit]
[-] bson-timestamp-serialization_error-004.phpt
[edit]
[-] manager-executeQuery_error-001.phpt
[edit]
[-] manager-ctor_error-002.phpt
[edit]
[-] bson-minkey-001.phpt
[edit]
[-] bson-javascript_error-001.phpt
[edit]
[-] bson-objectid-compare-002.phpt
[edit]
[-] server-construct-001.phpt
[edit]
[-] bson-regex-001.phpt
[edit]
[-] bson-timestamp-set_state_error-001.phpt
[edit]
[-] bson-toJSON-001.phpt
[edit]
[-] writeconcern-getwtimeout-001.phpt
[edit]
[-] bson-javascript_error-002.phpt
[edit]
[-] bson-toPHP-004.phpt
[edit]
[-] bson-objectid-getTimestamp-001.phpt
[edit]
[-] bson-regex_error-002.phpt
[edit]
[-] replicaset-seedlist-001.phpt
[edit]
[-] readpreference-getTagSets-001.phpt
[edit]
[-] bson-maxkey-jsonserialize-001.phpt
[edit]
[-] bson-regex-jsonserialize-001.phpt
[edit]
[-] bson-javascript-set_state-001.phpt
[edit]
[-] writeconcern-ctor_error-005.phpt
[edit]
[-] bson-fromJSON_error-001.phpt
[edit]
[-] manager-executeBulkWrite_error-006.phpt
[edit]
[-] standalone-auth-0001.phpt
[edit]
[-] bson-decimal128-set_state_error-002.phpt
[edit]
[-] bson-fromPHP_error-001.phpt
[edit]
[-] bson-utcdatetime-002.phpt
[edit]
[-] bson-timestamp-jsonserialize-001.phpt
[edit]