Commit Graph

3944 Commits

Author SHA1 Message Date
Andreas Braun
4fd0fa96a6 PHPC-2141: Emit deprecation notice for WriteResult getters with unacknowledged writes (#1367) 2022-10-05 16:15:38 +02:00
levon80999
d6b2fd6077 PHPC-1929: ReadConcern tests need not exhaustively test each constant (#1360) 2022-09-27 14:42:42 +04:00
levon80999
93265d430e PHPC-2136: Final modifier should precede method visibility in stub files (#1364) 2022-09-16 15:27:35 +04:00
Andreas Braun
6db48b821f PHPC-2064: Use register_shutdown_function to disable caching of skipif results (#1366) 2022-09-16 08:49:55 +02:00
Andreas Braun
04f504c9fa PHPC-2121: Skip failing test (#1365)
* PHPC-2121: Skip failing test

* Add todo comment to SKIPIF check

Co-authored-by: Jeremy Mikola <jmikola@gmail.com>

Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
2022-09-16 08:48:51 +02:00
Jeremy Mikola
f0421fa1fe PHPC-2103: Report loaded crypt_shared version in phpinfo() (#1351)
* Match error message variations between libmongoc 1.23+ and older

This typo was corrected in mongodb/mongo-c-driver@1d7229f0e9 and will appear in the 1.23.0 release.

* PHPC-2103: Report loaded crypt_shared version in phpinfo()

* PHPC-2132: Fix pattern for matching phpinfo() values
2022-09-14 17:28:13 -04:00
levon80999
9df0785fea PHPC-2101: Default Binary constructor parameter to TYPE_GENERIC (#1362) 2022-09-15 00:23:24 +04:00
levon80999
584766c12b PHPC-1944: Add final modifier to __set_state methods (#1357) 2022-09-13 18:08:27 +04:00
Andreas Braun
77950c5664 PHPC-2130: Remove proto comments in favour of stubs (#1350)
* PHPC-2130: Remove proto comments in favour of stubs

* Remove emacs folding markers
2022-09-13 14:40:48 +02:00
levon80999
7a0b04c9a1 PHPC-1928: Remove unnecessary casts to zend_long (#1356) 2022-09-12 15:19:09 +04:00
Jeremy Mikola
e74bc3f6b5 Merge branch 'v1.14' 2022-09-09 19:17:51 -04:00
Jeremy Mikola
34e2d70552 Back to -dev 2022-09-09 19:12:00 -04:00
Jeremy Mikola
15f5475000 Package 1.14.1 1.14.1 2022-09-09 19:10:52 -04:00
Jeremy Mikola
2790a68af1 Bump upcoming-stable libmongoc-version to r1.23 branch 2022-09-09 16:03:25 -04:00
Jeremy Mikola
5c0b2c4f04 Merge branch 'v1.14' 2022-09-09 16:01:06 -04:00
Jeremy Mikola
620778dbf5 PHPC-2137: Bump libmongoc-version in Evergreen config (#1361) 2022-09-09 16:00:37 -04:00
Jeremy Mikola
6a7edac1f1 PHPC-2137: Upgrade libmongoc to 1.22.1 and libmongocrypt to 1.5.2 (#1358) 2022-09-08 19:31:27 -04:00
Jeremy Mikola
7f7ea9f7ab Merge branch 'v1.14' 2022-09-07 11:29:15 -04:00
Jeremy Mikola
fa7dd55c13 PHPC-2135: Test with consistent version of crypt_shared (#1353)
Use the crypt_shared library provisioned by download-mongodb.sh and add an additional task to disable the library and fall back to mongocryptd.

This also revises how we pass environment variables into run-tests.sh and the test suite. Everything is now explicitly passed instead of relying on export attributes from a parent context.
2022-09-07 11:28:13 -04:00
Jeremy Mikola
7588da26bf Restructure docs for environment variables (#1354) 2022-09-01 16:36:39 -04:00
Jeremy Mikola
dfa4c20f8b Merge branch 'v1.14' 2022-08-30 15:57:06 -04:00
Jeremy Mikola
746919519c PHPC-2131: Ensure CRYPT_SHARED_LIB_PATH is exported for tests (#1352)
This also fixes the injection logic in create_test_manager(), which should only kick in when "autoEncryption" opts are specified (as PHPLIB does) and check for a valid $driverOptions structure (to accomodate manager-ctor error tests).
2022-08-30 11:37:08 -04:00
Andreas Braun
2b03e66bbb PHPC-2128: Create stub file for functions (#1349)
* PHPC-2128: Create stub file for functions

* Fix wrong phpdoc comment formatting
2022-08-26 11:37:40 +02:00
Jeremy Mikola
de5f1e5a93 PHPC-2083: Allow enums to be instantiated during BSON decoding (#1317)
Enums serialize like PHP objects with a "name" property (BackedEnum instance will also have a "value") and thus become BSON documents. In order for a document to unserialize back to an enum, it must implement either Unserializable or Persistable. The bsonUnserialize() method serves no purpose for initialization, but it will still be invoked.

This introduces a PersistableEnum trait, which can be used for both Unserializable or Persistable implementations.

Co-authored-by: Sara Golemon <pollita@php.net>
2022-08-25 23:09:45 -04:00
Andreas Braun
28b4d4653c PHPC-2015: Fix wrong return types in stubs (#1348) 2022-08-19 09:35:29 +02:00
Jeremy Mikola
c99a8563bf PHPC-2093: Key Management API (#1339)
* PHPC-2120: Bump libmongoc 1.22.1 and libmongocrypt 1.5.2

* Clean keyvault collection before CSFLE tests

* Test invalid keyMaterial option for ClientEncryption::createDataKey()

* ClientEncryption::createDataKey() "keyMaterial" option

* ClientEncryption key management methods

Use ClientEncryption::getKey in createDataKey tests

* Require server 4.2+ for CSFLE integration tests

* Accommodate PHP 7.2 error message in createDataKey error test
2022-08-18 12:15:54 -04:00
Andreas Braun
104b2f802c PHPC-2124: Ensure that null is still accepted for optional parameters (#1347) 2022-08-18 12:47:18 +02:00
levon80999
b590d793a1 Merge pull request #1345 from mongodb/PHPC-1945
PHPC-1945: Remove class_exists checks from SKIPIF blocks in Decimal128 tests
2022-08-16 16:11:33 +04:00
Andreas Braun
0a712a3265 PHPC-2118: Test load-balanced on debian11 (#1344) 2022-08-16 10:47:39 +02:00
levon80999
c30e8a2890 PHPC-1945: Remove class_exists checks from SKIPIF blocks in Decimal128 tests 2022-08-16 12:21:42 +04:00
Andreas Braun
1169d832de PHPC-2015: Clean up stub files for BSON classes (#1341) 2022-08-04 08:55:12 +02: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
Andreas Braun
e2f91446bc PHPC-2111: Replace zend_parse_parameters calls with macros (#1338)
* Replace zend_parse_parameters calls with macros

* Fix warning about uninitialized variable

* Fix wrong parameter type in Server::executeBulkWrite

* Add compat macro for Z_PARAM_ARRAY_OR_OBJECT
2022-07-26 12:06:55 +02:00
Andreas Braun
da4d0716cb Master is now 1.15-dev 2022-07-26 12:03:32 +02:00
Jeremy Mikola
e9bab1e0b3 Back to -dev 2022-07-16 14:03:25 -07:00
Jeremy Mikola
1a3e32951e Package 1.14.0 1.14.0 2022-07-16 14:02:00 -07:00
Jeremy Mikola
f326c23461 PHPC-2091: Bump libmongoc 1.22.0 and libmongocrypt 1.5.0 (#1336) 2022-07-13 00:27:38 -04:00
Jeremy Mikola
63540009f7 PHPC-2104: ClientEncryption::QUERY_TYPE_EQUALITY is a string (#1334)
* Define additional constants in mongocrypt-export.h

* PHPC-2104: ClientEncryption::QUERY_TYPE_EQUALITY is a string

Downstream change since MONGOC_ENCRYPT_QUERY_TYPE_EQUALITY was changed to a string type.

Bumps libmongocrypt submodule to 1.5.0-rc2. Related to this bump, mongocrypt.h is no longer generated.

Bumps libmongoc submodule to 1.22-dev.
2022-06-24 14:59:17 -04:00
Jeremy Mikola
03fcb6b9ef PHPC-2099: crypt_shared testing (#1333)
* Use non-breaking space in OS axis labels

* Revise titles and Manager construction in autoEncryption tests

* Define CSFLE_KEY_VAULT_NS and CSFLE_LOCAL_KEY constants

The value for CSFLE_KEY_VAULT_NS is based on the example from PHPLIB-826. This was not required but helps makes all tests consistent and will make it easier if we need to add functionality to a helper to drop the key vault collection before a test.

Using CSFLE_LOCAL_KEY allows removal of a duplicated string literal in various CSFLE tests. Although the new constant wasn't required for all tests (empty strings worked fine to satisfy option validation), using a constant helps ensure consistency across the test suite.

Also use create_test_manager() in more places when basic.inc is included. The remaining instances of direct Manager construction should only be in tests where basic.inc isn't used.
2022-06-22 13:37:56 -04:00
Jeremy Mikola
dec2ed29b9 PHPC-2086: Test against MongoDB 6.0 in Evergreen and revise matrices (#1332)
Update axes definitions:
 * Add "mongodb" to version and edge-version axes names
 * Add MongoDB 6.0 to mongodb-versions axis
 * Fix latest-stable in mongodb-edge-versions axis (5.0 label was actually using MongoDB 4.0)
 * Bump latest-stable in php-edge-versions axis to PHP 8.1
 * Use debian11 for testing server versions not on debian92
 * Make RHEL host names consistent with those in mongo-php-toolchain
 * Fix label for zSeries (7.4 label was always using RHEL 7.2)

Revise test matrices:
 * Test all PHP versions with latest-stable MongoDB on Debian 11 and RHEL 7.0
 * Test all topologies and MongoDB versions with latest-stable PHP version on Debian
 * Restrict testing of ARM64, Power8, and zSeries architectures to MongoDB 4.4
 * Restrict testing of non-WiredTiger storage engines to MongoDB 4.0
 * Update mongodb-versions for OCSP, Stable API, and load balancer matrices
 * Use Debian 10 for OCSP testing (MongoDB 4.4+)
 * Use Debian 11 for Stable API testing (MongoDB 5.0+)
 * Keep Debian 9.2 for load balancer testing and remove MongoDB 6.0. Switch to Debian 11 once haproxy is available (see: BUILD-15237)

Use standalone-ssl, replicaset-auth, and sharded tasks for most matrices. The full set of tasks will be used for testing "all topologies and MongoDB versions".
2022-06-17 21:18:23 -04:00
Jeremy Mikola
285e056b78 Back to -dev 2022-06-07 21:06:48 -04:00
Jeremy Mikola
8a01ca7308 Package 1.14.0beta1 1.14.0beta1 2022-06-07 21:05:56 -04:00
Jeremy Mikola
e5c8889e4d PHPC-2078: Include relocated phongo_version.h in PECL packages
This was missed in 476c5b3ae1
2022-06-07 21:02:46 -04:00
Jeremy Mikola
476c5b3ae1 PHPC-2078: Move phongo_version.h back to repository root (#1329) 2022-06-07 16:50:15 -04:00
Jeremy Mikola
5d8fe37a20 Bump libmongoc 1.22.0-beta0 and libmongocrypt 1.5.0-rc1 (#1328) 2022-06-06 11:01:25 -04:00
Jeremy Mikola
8ae78ae00c Bump libmongoc and libmongocrypt submodules (#1326) 2022-06-02 08:45:00 -04:00
Jeremy Mikola
6b8f5c20a6 PHPC-2097: Enable ClientEncryption constructor 2022-05-31 18:59:22 -04:00
Jeremy Mikola
1cdfd0d51e PHPC-2098: Fix phongo_clientencryption_init signature when compiling without CSFLE 2022-05-31 18:59:22 -04:00
Jeremy Mikola
2063c2099f Revise error messages for autoEncryption and ClientEncryption options 2022-05-31 18:59:22 -04:00