Commit Graph

56 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
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
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
140bf287d5 Fix titles in Server tests 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
f40db84527 Fix expected output for Server::executeCommand() test 2017-12-12 15:55:12 -05:00
Jeremy Mikola
154ca9317b Test MONGOC_CMD_RAW options for Server::executeCommand()
This test is adapted from manager-executeCommand-004.phpt.
2017-12-12 15:11:46 -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
ecaeb2c1a2 Replace tabs with spaces in test files 2017-12-12 08:17:59 -05:00
Derick Rethans
4c5f9a6e46 PHPC-934: Fixed tests for MongoDB 3.6 2017-12-08 12:23:12 +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
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
5a00dcead0 PHPC-1036: Update test suite for MongoDB 3.6 2017-11-13 18:09:21 +00:00
Jeremy Mikola
925963199d PHPC-692: Check for phongo_bson_to_zval_ex() failures in Server methods 2017-05-08 12:22:20 -04:00
Jeremy Mikola
ee613c214c PHPC-628: Throw InvalidArgumentException when executing empty BulkWrite 2017-05-08 12:21:03 -04:00
Jeremy Mikola
d5f41f659d PHPC-411: Drop system.profile collection before tests 2017-03-15 10:44:45 -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
2599607b47 PHPC-635: WriteResult debug handler should return objects 2016-12-19 09:40:29 -05:00
Jeremy Mikola
97a26a18e7 Remove unnecessary SKIPIFs from extends tests 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
8f9e6c8c53 PHPC-498: ReadPreference, ReadConcern, and WriteConcern should serialize to BSON 2016-09-19 20:33:14 +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
a327a22cb8 Merge branch 'v1.1' 2016-06-02 11:20:03 -04:00
Jeremy Mikola
05fcc2ea4f PHPC-671: Avoid mongoc_client_t use-after-free by Cursor and Server 2016-05-31 15:10:53 -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
db0e3031f4 PHPC-693: Unacknowledged write result reports null counts
In CDRIVER-1194, the reply BSON was changed to be empty for unacknowledged writes.
2016-05-03 13:03:51 -04:00
Jeremy Mikola
e2209d50b8 PHPC-689: Use mongoc_cursor_set_hint() for query/command execution
Test changes were necessary because mongoc_cursor_set_hint() forces the slaveOk flag (CDRIVER-903).
2016-04-29 14:32:09 -04:00
Jeremy Mikola
f15f20ad0b Server::executeCommand() takes a database name, not a namespace 2016-04-29 14:32:01 -04:00
Jeremy Mikola
2fa57d7d05 Regression test for extending final classes 2016-02-09 15:25:14 -05:00
Jeremy Mikola
5b00e22101 PHPC-515: Test that negative cursor limits return one batch 2016-02-03 10:35:57 -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
Jeremy Mikola
d08d974ad3 PHPC-450: Profiled aggregate commands log the collection NS in 3.2 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
f50332911d PHPC-441: slaveOk bit is now set on hinted secondary query
This was fixed by CDRIVER-903, which is included in libmongoc 1.2.0.
2015-10-14 14:16:46 -04:00
Hannes Magnusson
e75191e67a PHPC-441: Skip (xfail) these tests while the ticket is being worked on 2015-10-07 13:42:01 -07:00
Jeremy Mikola
51a9ad7ef4 PHPC-409: $readPreference is no longer sent to non-mongos nodes
Fixed by CDRIVER-704
2015-10-05 12:22:46 -04:00
Jeremy Mikola
98887ff579 PHPC-438: Debug handler should display null for no WC error 2015-10-05 12:22:46 -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
Jeremy Mikola
c224e6d56e PHPC-381: Print whether profile commands were successful 2015-09-09 14:38:01 -07:00
Jeremy Mikola
88307b440d PHPC-381: Server::executeQuery/Command() should take a read preference 2015-09-04 16:11:25 -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
Derick Rethans
ae0cfeae20 Allow for PHONGO-SERVERS.json in ~ (and fix a test case name) 2015-08-19 16:56:19 +01:00
Jeremy Mikola
0d73e362f9 PHPC-271: Server::executeBulkWrite() should take a write concern 2015-08-14 01:08:58 -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