Commit Graph

258 Commits

Author SHA1 Message Date
Jeremy Mikola 29e5121cb7 PHPC-433: Persist mongoc_client_t objects in a HashTable
Clients will be hashed by Manager constructor arguments. Since they must persist between requests, the Manager destructor will no longer free the client and we'll need to start using persistent memory allocation for libbson and libmongoc.
2016-09-08 11:10:34 -04:00
Jeremy Mikola c673e0aee2 PHPC-704: Do not set mongodb.debug from driver options
The mongodb.debug INI option is a global setting and should not be set based on a single Manager's constructor argument.
2016-09-07 18:08:19 -04:00
Derick Rethans 0ab5d5c74c PHPC-752: Allow users to set a limit on acceptable staleness 2016-08-31 14:41:58 -04:00
Derick Rethans f7b8905085 Debugging through mongodb.debug no longer works 2016-08-31 18:11:53 +01:00
Derick Rethans 39044213f3 Fixed tests, as MongoDB 3.3 adds an extra item 2016-08-31 18:11:53 +01:00
Jeremy Mikola ae6016e7ba PHPC-605: Revise tests for libmongoc socket handling
Expected output changes now that PHP streams are no longer used for socket IO.
2016-08-30 14:04:56 -04:00
Jeremy Mikola 7f485f921e PHPC-761: Tests can rely on MongoDB\BSON namespace 2016-08-05 14:06:58 -04:00
Jeremy Mikola 5fbcef0638 PHPC-746: Default Manager URI to "mongodb://127.0.0.1/" 2016-07-15 11:14:45 -04:00
Jeremy Mikola 4e26b503bd Declare __wakeup as lowercase for consistency 2016-07-15 11:11:48 -04:00
Jeremy Mikola a327a22cb8 Merge branch 'v1.1' 2016-06-02 11:20:03 -04:00
Jeremy Mikola 3b06e81f9a PHPC-572: Keep stream context options alive for Manager's lifetime 2016-06-01 22:54:08 -04:00
Jeremy Mikola c0046a3e63 PHPC-673: Fix Cursor::isDead() tests for mongoc_cursor_is_alive()
This changes our tests based on upstream fixes for mongoc_cursor_is_alive() in CDRIVER-1221.
2016-05-17 16:12:13 -04:00
Jeremy Mikola 78839bde83 PHPC-688: Change Cursor debug handler to use libmongoc public API
This significantly alters the structure of the Cursor's debug output, since we not longer have access to private fields within mongoc_cursor_t.
2016-05-06 11:48:31 -04:00
Jeremy Mikola acc06c176d Update expected error message for server selection failures
This message was changed in https://github.com/mongodb/mongo-c-driver/commit/ed4d53ec873952ac929bc3f4467a935dde2a0681 for CDRIVER-1203.
2016-05-03 13:03:51 -04:00
Jeremy Mikola ae801ee37f PHPC-600: Use mongoc_client_get_server_descriptions() to get Manager's Servers 2016-04-12 15:29:41 -04:00
Jeremy Mikola d1079cfabb PHPC-564, PHPC-626: WriteResult should use libmongoc's public API
This changes WriteResult to encapsulate a bson_t, which is populated by mongoc_bulk_operation_execute(), instead of the private mongoc_write_result_t struct. This entailed significant changes to the WriteResult debug handler, so new tests have been added for it.

With phongo_execute_write() modified to populate a bson_t reply, we also changed error handling to pull a BulkWriteException message from bson_error_t (PHPC-626). That change required several error tests to be modified for the new message format.
2016-03-21 11:42:28 -04:00
Derick Rethans 5c366ee5b4 Fixed PHPC-506: Use more descriptive messages in WriteExceptions 2016-03-01 14:07:54 +00:00
Jeremy Mikola 016eaf8aa0 PHPC-581: Use ConnectionTimeoutException for server selection failures 2016-02-15 12:41:28 -05:00
Jeremy Mikola a287ded536 PHPC-553: Relax expected output patterns for HHVM 2016-02-15 12:36:51 -05:00
Jeremy Mikola cca7d04fef PHPC-553: Suppress warnings during stream creation
This allows PHP's warnings during connection initialization (e.g. unresolvable host names) to be captured into the bson_error_t, which is later used to throw an exception.
2016-02-15 12:36:51 -05:00
Jeremy Mikola 2930c348db PHPC-566: Remove request_id from Manager::__debugInfo() 2016-02-15 12:09:17 -05:00
Jeremy Mikola d9674b5bd0 PHPC-523: Parse readconcernlevel in URI options array 2016-02-11 17:21:18 -05:00
Jeremy Mikola 2fa57d7d05 Regression test for extending final classes 2016-02-09 15:25:14 -05:00
Jeremy Mikola 9d04bcd69c PHPC-509: Default Manager URI to "mongodb://localhost:27017/" 2015-12-14 18:01:31 -05:00
Jeremy Mikola 90d438e626 PHPC-448: Manager::getReadConcern() and URI test 2015-12-11 15:22:55 -05:00
Jeremy Mikola bea901d170 PHPC-443: Support "bypassDocumentValidation" option in BulkWrite 2015-12-11 13:43:14 -05:00
Jeremy Mikola b54a8bf05b PHPC-450: Split query tests for OP_QUERY and find command
This also entails a change to done/end_of_event cursor field assertions. These are internal libmongoc cursor fields and their values aren't relevant to the tests. In the future, we may consider removing them from the Cursor's dump output.
2015-12-10 12:16:36 -05:00
Hannes Magnusson 49225e1dc7 PHPC-495: Upgrade bundled libbson and libmongoc to 1.3.0 2015-12-02 18:11:46 +00:00
Jeremy Mikola fe9fb63267 PHPC-465: Remove Manager's single write methods
Existing tests for single write methods were ported to executeBulkWrite() tests.
2015-10-21 19:32:42 -04:00
Jeremy Mikola 52dfd6b2d2 PHPC-444: Support options array in BulkWrite and executeInsert() 2015-10-15 15:44:17 -04:00
Remi Collet aeb2bc4669 PHPC-442: report PHP version in debug info 2015-10-05 17:28:23 -04:00
Remi Collet efde19a1de report runtime version in debug mode 2015-10-05 17:28:23 -04:00
Jeremy Mikola 31661a383d Test write and WC error extraction for single write methods 2015-10-05 16:15:10 -04:00
Jeremy Mikola dcbf5ae6ba PHPC-428: Remove support for WriteConcern fsync option 2015-09-23 11:47:53 -04:00
Jeremy Mikola a6932d59e0 PHPC-423: WriteConcern should report default "w" option as null 2015-09-22 14:07:23 -04:00
Derick Rethans 73ab90eb4d Skip logging tests for HHVM, which will use its own method 2015-09-22 11:02:03 -04:00
Jeremy Mikola 81c763442b PHPC-417: Return value objects from Manager RP/WC getters 2015-09-15 15:19:35 -04:00
Jeremy Mikola a2c88be3ff PHPC-361: Manager::getServers() should omit unknown servers 2015-09-01 13:36:28 -04:00
Jeremy Mikola 57871d1f4b PHPC-340: BSON\UTCDateTime debug handler
The milliseconds will be dumped as a string value on 32-bit platforms.
2015-08-26 15:57:08 -04:00
Jeremy Mikola cb0249892a Bump extension version to 1.0.0alpha1 2015-08-20 16:03:35 -04:00
Jeremy Mikola 960c51ace7 Split out Manager constructor error tests
The extra arguments test can be skipped for HHVM (as was done in #74).

The read preference and write concern tests attempt to cover all permutations of invalid arguments. Detailed exceptions are only possible where we apply array options to the structures, since libmongoc currently provides no detailed errors when URI parsing fails (see: CDRIVER-782).
2015-08-13 16:12:33 -04:00
Jeremy Mikola 3b7f42b83d PHPC-196: Implement Manager getters for WC and RP 2015-08-13 16:12:33 -04:00
Hannes Magnusson b9fa29f24b bump debug tests after slight tracing changes 2015-07-22 13:47:43 -04:00
Hannes Magnusson d017a80ea0 PHPC-229: Support options array in second parameter of Manager ctor 2015-07-22 13:47:43 -04:00
Jeremy Mikola 965f8c3db4 PHPC-315: Support "root" type mapping for top-level documents 2015-07-14 19:52:24 -04:00
Jeremy Mikola 6eb0944565 PHPC-319: Convert top-level documents to stdClass by default
Update tests to expect stdClass for documents. Debug handlers and the Server getter methods will still decode documents as native arrays.
2015-07-11 00:38:05 -04:00
Jeremy Mikola d34a09edf1 Use plural property name to store list of Address objects 2015-07-10 23:55:50 -04:00
Hannes Magnusson 808ee36ca8 PHPC-321: UTCDatetime -> UTCDateTime 2015-06-30 10:30:27 -07:00
Hannes Magnusson ed1cd1e30b PHPC-309: Bump tests 2015-06-30 10:04:36 -07:00
Hannes Magnusson 9a7cabad6b Improve code covergae 2015-05-13 21:13:17 -07:00