-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
As noted in PHPLIB-592:
PHP 8 upgraded some former notices into warnings (https://www.php.net/manual/en/migration80.incompatible.php). Accessing an undefined array key was one such upgrade. This creates a potential issue for Operation::assert() in the unified spec test runner, since warnings were previously captured specifically to ensure expectError assertions catch stream errors in GridFS.
One valid-fail test for load balancer support (schema version 1.3; PHPLIB-669) is expecting an error due to a missing operation arg (see: ignoreResultAndError: malformed operation fails if ignoreResultAndError is true).
The existing test runner implementation accesses required parameters without checking that the key exists. When a key does not exist, PHP 7.x raises a noise while PHP 8.x raises a warning. In both cases, the test would fail; however, this will cause an issue with ignoreResultAndError since PHPLIB-592 requires that we allow expectError a chance to inspect warnings (due to how GridFS stream errors are currently raised).
A proper work-around for this will entail explicitly asserting both the presence and type of required operation args before we access them. The, we can safely rely on PHPUnit assertion failures instead of differing behavior in PHP itself.
- is related to
-
PHPLIB-669 Unified test runner changes for load balancer support
- Closed
-
PHPLIB-592 Allow GridFS StreamWrapper to throw on error instead of emitting a PHP warning
- Closed
-
PHPLIB-665 Mitigate pain of using field names with dots and dollars
- Closed