Commit Graph

114 Commits

Author SHA1 Message Date
Derick Rethans d0d3cc7f96 Ensure these tests only run with wiredTiger engine 2018-01-12 11:55:41 +00:00
Derick Rethans 86ac6ec4ff Re-enable test that was disabled for ages as it works fine on Travis now. 2018-01-12 11:55:41 +00:00
Derick Rethans 1e06f3428f Replace check for 'TRAVIS' with MongoDB server version check 2018-01-12 11:55:41 +00:00
Jeremy Mikola 0e737ebca1 Remove XFAIL tests depending on PHPC-1066 2018-01-03 12:58:10 -05:00
Jeremy Mikola bfbbbf1bab Regression test for empty command segfault (CDRIVER-2431) 2017-12-20 23:02:50 -05:00
Jeremy Mikola a0d579c6e5 PHPC-1066: XFAIL tests for unknown options to execute methods
These tests were extracted from previous tests that combined invalid/unknown options.
2017-12-18 12:11:57 -05:00
Jeremy Mikola b29c423fda PHPC-1057: Refactor option parsing for execute methods
Execute options are now parsed via php_array functions, which makes the options case-sensitive.

A helper function is now used to convert legacy options for the original three execute methods into an array. This simplifies option parsing in php_phongo.c.

Additionally, Manager methods now perform their own server selection, which means that execute functions in php_phongo.c can rely on a server_id being provided.

Tests have been updated to expect a serverId option when relevant (e.g. query opts). Additionally, error tests for execute methods have been improved so that invalid values for all known options are tested.
2017-12-18 12:11:57 -05:00
Jeremy Mikola 03af904b5d PHPC-1071: Report class name for unexpected object values
This only updates exceptions where object types are entirely unexpected. For instance, options that expect a BSON document (i.e. array or object) need not use this macro, as any object would be accepted.
2017-12-15 11:23:44 -05:00
Jeremy Mikola 70500074dd Note MONGOC_CMD_RAW in executeCommand() option tests
This serves as a reminder that executeCommand() is the execution method for raw commands.
2017-12-12 15:11:46 -05:00
Jeremy Mikola bf108818f8 Rename test case for executeCommand() 2017-12-12 15:11:46 -05:00
Jeremy Mikola dca4acff50 Update tests for unsupported URI option values
The error message was changed in mongodb/mongo-c-driver@a625b39a2e
2017-12-12 15:11:46 -05:00
Jeremy Mikola ecaeb2c1a2 Replace tabs with spaces in test files 2017-12-12 08:17:59 -05:00
Derick Rethans 03da646de1 PHPC-709: Add microseconds to log messages 2017-12-12 10:16:06 +00:00
Derick Rethans 4c5f9a6e46 PHPC-934: Fixed tests for MongoDB 3.6 2017-12-08 12:23:12 +00:00
Derick Rethans c1b85e814b Catch exceptions, so that we can still test writeConcern with ping 2017-11-29 16:33:30 +00:00
Derick Rethans d36784d1ee Skip some tests on Travis, as it doesn't run 3.6 yet 2017-11-29 16:33:06 +00:00
Derick Rethans 9467537a32 Fix test case name 2017-11-29 15:36:10 +00:00
Derick Rethans b2e90bbc65 Add test cases 2017-11-29 13:07:13 +00:00
Derick Rethans 87fbd007f0 PHPC-1042: Support options array for BulkWrite, Command, and Query execute methods 2017-11-27 16:21:58 +00:00
Derick Rethans f609ac7d35 PHPC-1037: Upgrade bundled libmongoc and libbson to 1.9 2017-11-21 14:47:12 +00:00
Derick Rethans 5a00dcead0 PHPC-1036: Update test suite for MongoDB 3.6 2017-11-13 18:09:21 +00:00
Jeremy Mikola 94ee50e5ef PHPC-1004: Rename ObjectID to ObjectId 2017-08-30 10:12:22 -04:00
Jeremy Mikola ce328f1a89 PHPC-887: Throw for unexpected types in URI options array
Note: generic boolean options (e.g. "ssl") will continue to accept non-boolean types for BC, since we cast via bson_iter_as_bool(). However, RP and WC-specific boolean options (e.g. "slaveOk", "journal") will throw since they previously silently ignored non-boolean values.

In addition to revising read preference tests, this adds new tests for read concern and write concern options.
2017-08-08 09:41:47 -04:00
Jeremy Mikola 7a79f14d67 Regression test for out of range maxStalenessSeconds option in URI string 2017-08-04 10:54:44 -04:00
Jeremy Mikola 3b171c795e PHPC-846: Throw if maxStalenessSeconds URI option is out of range 2017-08-04 10:54:44 -04:00
Jeremy Mikola bac8cb34aa Merge branch 'v1.2' 2017-07-10 09:36:53 -04:00
Jeremy Mikola e20653b574 Fix typo in test title
Type appears to have been introduced in 43b06f0ca3
2017-07-05 15:02:09 -04:00
Jeremy Mikola ee613c214c PHPC-628: Throw InvalidArgumentException when executing empty BulkWrite 2017-05-08 12:21:03 -04:00
Jeremy Mikola 773d36450e PHPC-772: Parse authMechanism options in URI options array 2017-04-26 11:48:35 -04:00
Jeremy Mikola 321fd72881 PHPC-942: Use mongoc_uri_new_with_error() to improve URI error reporting 2017-03-28 15:58:48 -04:00
Jeremy Mikola 5fa74afea5 Merge branch 'v1.2' 2017-03-28 14:12:32 -04:00
Jeremy Mikola f45916a38a PHPC-940: php_phongo_free_ssl_opt() attempts to free interned strings
This issue only manifests itself on PHP 7, since interned strings are tracked in the zval struct instead of the character pointer as in PHP 5.x.
2017-03-28 00:15:59 -04:00
Jeremy Mikola cdd10fe3e0 Merge branch 'v1.2' 2017-03-15 11:07:49 -04:00
Jeremy Mikola e6b8479506 Reorganize SKIPIF blocks in tests and add missing NEEDS() checks 2017-03-15 10:41:04 -04:00
Jeremy Mikola 9b9bd3db97 Regression test for constructing Manager with SSL but no driver options 2017-03-10 09:48:25 -05:00
Jeremy Mikola 06778c6928 PHPC-901: False slaveOk URI option should be ignored 2017-03-06 12:14:44 -05:00
Jeremy Mikola 0c5d4f36f3 Regression tests for slaveOk URI option 2017-03-06 12:14:44 -05:00
Jeremy Mikola 600db56bd8 PHPC-912: Do not destroy persisted clients created by other processes 2017-03-06 12:13:33 -05:00
Jeremy Mikola b55ea81fd6 PHPC-913: Child process should not re-use mongoc_client_t objects from parent 2017-02-13 17:21:39 -05:00
Jeremy Mikola 44ac5c4889 Manager debug ouput tests should not depend on libmongoc tracing
These tests were fragile and could fail when using libmongoc as a system library where tracing may not be enabled.
2017-02-07 18:43:23 -05:00
Jeremy Mikola e3c4439ae3 Remove Manager::executeBulkWrite() insert error test
In libmongoc 1.6.0, insert documents are validated during BulkWrite::insert(). This is a fragile test that fails when v1.2 is compiled against libmongoc 1.6.0 as a system library.
2017-02-07 16:30:04 -05:00
Jeremy Mikola 77be3df93d Manager::executeQuery() without assignment test is obsolete
Testing query execution without return value assignment is already handled by tests/query/bug0705-001.phpt.
2017-02-07 16:28:41 -05:00
Jeremy Mikola 120b270377 PHPC-851: Separate argument zvals before modification
This primarily fixes a bug introduced in 6d46d62577 for PHPC-359, since we convert tag sets from arrays to objects to ensure proper BSON serialization. Not only was the array mutation visible to calling contexts, but a crash could occur if the array was immutable due to OPcache.

For Manager's $driverOptions, a comment in 1060cb8ba4 for PHPC-433 indicated that we should have separated its zval due to possible modification, but the appropriate zend_parse_parameters() flag was never used.
2016-12-12 19:31:45 -05:00
Derick Rethans 43b06f0ca3 PHPC-827: Update Max Staleness implementation 2016-11-28 11:32:01 +00:00
Jeremy Mikola 6dc41c409f PHPC-676: Do not allow BulkWrite objects to be executed multiple times 2016-11-22 11:10:02 -05:00
Jeremy Mikola 6d46d62577 PHPC-359: Ensure RP tag sets serialize as documents 2016-09-26 10:53:21 -04:00
Jeremy Mikola 1fabf41a57 Fix Manager extends test, which previously duplicated Query 2016-09-21 16:32:39 -04:00
Jeremy Mikola f37f589bbc PHPC-783: Use mongoc_collection_find_with_opts() for Query exec
Query struct fields have been consolidated to a filter and opts BSON documents.

This also changes the Query debug output significantly.
2016-09-20 16:57:20 -04:00
Derick Rethans 53dec68a77 Disable test for HHVM, as we don't have logging for this 2016-09-20 15:00:36 +01:00
Jeremy Mikola 6ec5348957 Test that read preference options of the wrong type are ignored 2016-09-19 16:54:48 -04:00