Commit Graph

140 Commits

Author SHA1 Message Date
Jeremy Mikola
542d1d3007 Cross-reference prose tests in session test descriptions (#1393)
* Remove redundant params in create_test_manager() calls

* Use disableClientPersistence in session test requiring different clients
2022-12-22 03:21:45 -05:00
Andreas Braun
5f3503c01c PHPC-2165: Expose server error replies in BulkWriteResult (#1385) 2022-12-06 08:18:16 +01:00
Andreas Braun
6ffcb1f1dd PHPC-2117: Test on PHP 8.2 (#1340)
* Test on PHP 8.2

* Fix tests relating to dynamic properties

* Fix tests failing due to different __set_state output

* Duplicate clone test without dynamic properties for PHP >= 8.2
2022-08-04 08:53:25 +02:00
Andreas Braun
6887226d34 PHPC-1709: Add typing information to arginfo (#1337)
* Add missing macros for declaring arguments

* Add macros to define disabled constructor and __wakeup

* Define arginfo via stubs for BSON classes

* Declare tentative return types in interfaces

* Add correct return type for __set_state methods

* Generate class entries for BSON classes

* Declare Binary class constants in stub file

* Use stubs in exception classes

* Add stubs for monitoring classes

* Fix wrong JsonSerializable class in BSON stubs

* Disable declaration-after-statement

This is necessary to let the generated arginfo files compile

* Use stubs for driver classes

* Fix deprecation messages in tests

* Add missing macro

* Fix tests relying on value injection

* Parse parameters in disabled constructor/wakup function

* Add note about arginfo files to contribution docs

* Add GitHub action to check generated arginfo files

* PHPC-2115: Use DateTimeInterface in UTCDateTime constructor signature

* Don't install mongodb extension in GitHub actions workflows

* Change indentation in stub files

* Use individual #if conditions for each stub method

* Make disabled constructor/wakeup methods static

* Fix bulkWrite parameter name

* Use %d to match property count in tests

* Ensure all classes with disabled serialisation declare __wakeup
2022-08-03 08:42:07 +02:00
Jeremy Mikola
ded3db3128 PHPC-2027: Add PHP 8.1 to AppVeyor and bump older versions (#1290)
* PHPC-2027: Add PHP 8.1 to AppVeyor and bump older versions

* Swap order of checking for configureFailPoint
2022-01-10 13:05:03 -05:00
Jeremy Mikola
0e45605fa2 PHPC-1937: Manager::selectServer() defaults to primary read preference (#1267)
* Use .invalid TLD for invalid host in tests

See: https://datatracker.ietf.org/doc/html/rfc2606

* PHPC-1937: Manager::selectServer() defaults to primary read preference
2021-10-26 13:07:21 -04:00
Andreas Braun
deead9687e PHPC-1716 Allow configuring server API version in manager (#1204)
* Introduce MongoDB\Driver\ServerApi

* Accept serverApi driver option

* Introduce create_test_manager factory to create manager

A centralised entry point is required to inject the API_VERSION env variable later.

* Add build variant to test with requireApiVersion=true

* Fix wrong configuration for auth variable

This changed when migrating from our own scripts to drivers-evergreen-tools and was not updated properly, causing all tests to run with auth disabled.

* Declare ZEND_PARSE_PARAMETERS_NONE macro

This macro is missing on PHP < 7.3

* Remove duplicated API param storage

* Add missing semicolons

* Add ZEND_PARSE_PARAMETERS_NON_EX macro

* Extract error handling functionality to separate macros

* Throw if internal mongoc_server_api_t is already initialised

* Use imported namespaces in tools file

* Fix type info for reflection

* Use American English spelling

* Only use typed serialize signature on PHP 8+

* Update PHONGO_PARSE_PARAMETERS_NONE macro for PHP < 7.3

* Remove usage of ZEND_STRL within zend_hash_str_add

This causes compile failures on PHP < 7.3 that I have yet to understand.

* Fix errors in new PHONGO_PARSE_PARAMETERS macros
2021-03-26 15:43:48 +01:00
Andreas Braun
201acd92f4 PHPC-1290: Update sharded test clusters to have multiple mongoses
This is necessary because session pinning doesn't work when connected to a single mongos node
2019-08-28 20:10:47 +02:00
Jeremy Mikola
119ec8ff8d Use EXPECTF for assertion with pattern match 2019-06-07 11:22:20 -04:00
Jeremy Mikola
e65c598833 PHPC-1392: Fix error assertion for server 3.0 through 3.4 2019-06-07 10:28:08 -04:00
Jeremy Mikola
75080c3fe8 PHPC-1392: Bump socketTimeoutMS to avoid spurious failure 2019-06-04 10:20:06 -04:00
Derick Rethans
f645aad242 PHPC-1239: Passing SSL driversOptions to Manager constructor overrides SSL options in URI 2018-07-31 11:04:16 +01:00
Derick Rethans
7ae04b25bc Disable test case for PHPC-431 until PHPC-1239 is resolved 2018-07-16 10:30:39 +01:00
Derick Rethans
3678fa5236 PHPC-1184: Add alternative topologies to Travis 2018-07-16 10:30:39 +01:00
Jeremy Mikola
6cafb280f3 PHPC-1113: Use skip_if_not_standalone() for tests requiring a standalone 2018-05-02 16:39:00 -04:00
Jeremy Mikola
014f2b6435 Create append_uri_option() helper function
This removes previous assumptions about the structure of the URI string.
2018-05-02 16:04:09 -04:00
Jeremy Mikola
73fc8a5bd4 Finish sentence in test comment
This sentence has been dangling since ae0219d69e.
2018-05-02 16:04:09 -04:00
Jeremy Mikola
58fa85e85e PHPC-1113: Use common URI constant 2018-05-02 16:04:09 -04:00
Jeremy Mikola
5f7f350670 PHPC-1113: Replace NEEDS('STANDALONE') with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
b4062f880c PHPC-1113: Replace CLEANUP() with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
38405a7f19 PHPC-1113: Replace TESTCOMMANDS() with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
1877e6a01a Fix variable name in test
This fixes a typo introduced in 4967eff756.
2018-04-16 13:34:33 -04:00
Jeremy Mikola
4967eff756 Invalid namespace test needs STANDALONE
This reverts changes from 0b200dda09 and is related to PR #806 for v1.4.
2018-04-16 13:23:20 -04:00
Jeremy Mikola
a2638aeeec Merge branch 'v1.4' 2018-04-16 13:22:00 -04:00
Jeremy Mikola
1904f7e935 Invalid namespace tests needs STANDALONE
In b29c423fda for PHPC-1057, Manager's execute methods were changed to perform server selection before invoking the phongo_execute functions, which throw InvalidArgumentExceptions such as this. Without a running standalone server, this test will encounter a server selection failure before we have a chance to parse the namespace string.
2018-04-16 12:05:57 -04:00
Katherine Walker
1ad6d75b5c PHPC-1090: Clean up switch statements for exception class selection 2018-03-13 13:21:59 -04:00
Jeremy Mikola
a925cbf3f5 Require server in SKIPIF before using its constant in FILE 2018-02-27 09:48:25 -05:00
Jeremy Mikola
0b200dda09 PHPC-1133: Remove unused includes in SKIPIF and FILE sections 2018-02-27 09:48:25 -05:00
Jeremy Mikola
05c83bdef2 PHPC-1132: Remove HHVM checks in test suite 2018-02-27 09:48:25 -05:00
Jeremy Mikola
94ee50e5ef PHPC-1004: Rename ObjectID to ObjectId 2017-08-30 10:12:22 -04:00
Jeremy Mikola
15a40bd7c7 PHPC-942: Remove PHPC-159 regression test
The patch in PHPC-159 was removed along with stream handlers in PHPC-605. As of PHPC-942, the URI in the test fails parsing and an exception is thrown long before a stream is constructed.
2017-03-28 16:46:48 -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
59dc7c7ebf Remove obsolete tests for PHPC-487
These tests were originally written with the PHP stream handler in mind, which is no longer used in 1.2.0+.
2017-02-08 14:19:43 -05:00
Jeremy Mikola
2599607b47 PHPC-635: WriteResult debug handler should return objects 2016-12-19 09:40:29 -05:00
Jeremy Mikola
081331ee2b Update closed socket test for libmongoc stream handling
The previous error message was based on PHP's stream handlers, which are no longer used in 1.2.x.
2016-12-13 14:29:00 -05:00
Derick Rethans
8f9e6c8c53 PHPC-498: ReadPreference, ReadConcern, and WriteConcern should serialize to BSON 2016-09-19 20:33:14 +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
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
acc06c176d Update expected error message for server selection failures
This message was changed in ed4d53ec87 for CDRIVER-1203.
2016-05-03 13:03:51 -04:00
Jeremy Mikola
786a1a5c62 Merge branch 'v1.1' 2016-04-28 16:39:59 -04:00
Jeremy Mikola
6f5f38a8a2 Fix expected exception message for PHPC-487 test case 2016-04-28 16:38:48 -04:00
Jeremy Mikola
4a64b3d300 Merge branch 'v1.1' 2016-03-29 15:56:46 -04:00
Jeremy Mikola
e097a0934c PHPC-655: Use case insensitive parsing for Manager connectTimeoutMS array option 2016-03-29 15:55:59 -04:00
Jeremy Mikola
6915ffd37f DRIVERS-289: Test iteration on live command cursor with empty first batch 2016-03-14 13:52:42 -04:00
Jeremy Mikola
4e2ab1b619 Skip PHPC-545 test on HHVM due to __pclass encoding order 2016-03-04 11:27:40 -05:00
Jeremy Mikola
e430814221 Revert "Merge pull request #241"
This reverts commit f5edbe2665, reversing
changes made to 6aaa45d380.
2016-02-29 12:27:11 -05:00
Jeremy Mikola
f1c7be8318 wip 2016-02-25 10:14:47 -05:00
Jeremy Mikola
ba83c54cfe PHPC-545: Regression test for Peristable bug report 2016-02-15 12:49:00 -05:00
Jeremy Mikola
71b597cfa4 Tests should use and cleanup their own collection 2016-02-15 12:49:00 -05:00
Hannes Magnusson
97429ea258 PHPC-431: Add the testcase from the report 2015-12-16 10:22:58 +00:00