* Use zend_exception_ce instead of zend_exception_get_default()
zend_exception_get_default() has been deprecated since PHP 7.0. See: php/php-src@f9e9d3a437
* Check retval from php_phongo_set_monitoring_callbacks
This ensures that php_phongo_client_register is never called in the event this method fails (however unlikely).
* Index subscriber HashTable by numeric object handles
This also updates add/removeSubscriber to use the new argument parsing macros from deead9687e.
* PHPC-1804: Manager::addSubscriber and removeSubscriber
Implements per-client event subscribers. Moves existing APM code to a new phongo_apm.c module and adds logic to coordinate dispatching between global and per-client subscribers.
* 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
* Fix running auth tests
* Fix flaky tests on replica sets
* Remove arbiters from replica set config
This was done for auth due to a bug fixed in 3.7.7, but the change was not reverted (see https://github.com/mongodb-labs/drivers-evergreen-tools/pull/38).
* Harden test against non-deterministic return order
* v1.9:
PHPC-1739 Move from travis-ci to GitHub Actions (#1199)
PHPC-1774 Fix truncation of PHP_VERSION constant in handshake metadata (#1202)
PHPC-1775 Use correct size for strncpy in when initialising DBPointer (#1203)
* Add GitHub Action workflow for tests
* Add workflow to check formatting
* Remove travis-ci config
* Fix clang-format error
* Add shared json extension for tests
* Hide output for xfail tests
* Use mongo-orchestration configs from drivers-evergreen-tools
* Drop obsolete test scripts
This drops the legacy VM environment and remnants of the travis-ci config
* Remove obsolete server_id config
* Add note about MONGO_ORCHESTRATION_URI to contribution docs
* Restore previous XFAIL behaviour
This did not have the expected effect of preventing diff output for tests that expect failures, so it can be reverted.
* Make SSL certificate path configurable for tests
Since mongo-orchestration will always bring its own certificates, we need to set the correct SSL certificate directory for our tests. This is skipped on GitHub Actions as we don't test SSL builds there (yet). If SSL_DIR was not set, tests requiring SSL will be skipped.
* Fix code review nits
* PHPC-1529: Reset libmongocrypt key vault client after forking
* Run ping command instead of find
* Update wrong comment
* Only run tests when libmongocrypt is present
* Add mongocryptd.pid to gitignore
* Fix test failures due to missing mongocryptd
* Replace client pointers on object structs with Manager references
* Request-scoped Manager registry for APM events
* Ensure Manager is registered regardless of persistent client
* Reset request-scoped clients when forking
* Test for freeing Manager during RSHUTDOWN via subscriber reference
Co-authored-by: Andreas Braun <git@alcaeus.org>
MongoDB 4.0.x (and possibly earlier) happens to require an $out stage for aggregate if a writeConcern option would be used. While this test doesn't use a write concern, it could inherit one from MONGODB_URI.
As for findAndModify, that is only considered a write command (does not accept a readConcern option).
The previous inconsistency was likely the result of copypasta (especially where executeReadCommand was used). There is no issue with using executeCommand here since an explicit write concern is provided (nothing will be inherited).
Syncs tests with mongodb/specifications@1713439515. Includes tests for PHPC-1655 and PHPC-1652.
Adds logic to canonicalize $numberDouble values, which allows previously skipped tests to pass. This was noticed because SPEC-1537 changed the description of these tests and they were no loner skipped by convert-bson-corpus-tests.php.
The ReadConcern, ReadPreference, WriteConcern, and BSON classes have no properties beyond pointers to libmongoc/libbson structs; however, all of these classes use get_properties to report fields for var_export (PHPC-850, PHPC-460).
The standard get_gc handler defers to get_properties to collect other zvals for GC inspection. This is problematic for the aforementioned get_properties handlers, since a HashTable of zvals intended for debugging will be returned and those properties will already be freed by our free_object handler (via FREE_HASHTABLE).
Having each class define its own get_gc handler is the first step to fixing this issue. The BSON classes already defined their own get_gc handlers, but erroneously returned the internally cached properties directly.
The second step to fixing this issue is ensuring that get_gc delegates to zend_std_get_properties, as is done in various PHP core extensions. Doing so ensures that we do not leak other zvals that may be assigned as public properties by the application (covered by the second regression test), since zend_std_get_properties will return those for GC inspection.