You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #644 Align tests with PHP 8.6 changes to ext/tidy and ext/intl (nicolas-grekas)
This PR was merged into the 1.x branch.
Discussion
----------
Align tests with PHP 8.6 changes to ext/tidy and ext/intl
Fixes the two failures of the `PHPUnit Tests (8.6, apc, apcu, ... intl-73.2 ...)` job, which is red on `1.x` itself, plus an unrelated flaky test that failed in the same run.
### `DeepCloneTest::testTidyNodeRoundTrip`
php-src [`4782ec55aae`](php/php-src@4782ec55aae) (*Add NOT_SERIALIZABLE to XMLWriter, XMLReader, SNMP, tidy, and tidyNode*, php/php-src#21694, master only) marks `tidyNode` ``@not`-serializable` — it wraps a libTidy handle and "segfaults on use" once unserialized.
`ext/deepclone` honours `ZEND_ACC_NOT_SERIALIZABLE`, so on 8.6 both engines now refuse the node: the extension via that flag, the polyfill because `unserialize('O:8:"tidyNode":0:{}')` throws. Same exception, same message — only the test was stale.
Per the design principle that the `deepclone` polyfill mirrors the newest native state rather than each intermediate version, `tidyNode` joins `NOT_ROUND_TRIPPABLE`. The extension is more lenient below 8.6 (`tidyNode` is `final` and bare-instantiable there, so it passes the probe), so the test keeps the round-trip expectation for that combination.
### `NormalizerTest::testNormalizeWithInvalidForm`
php-src [`94e8c54ef27`](php/php-src@94e8c54ef27) (*ext/intl: Fix various error messages*, php/php-src#22828, master only) dropped the doubled article introduced back when intl warnings were promoted to exceptions. Both the polyfill and its test hardcoded `must be a a valid`, so the message is now conditional on `PHP_VERSION_ID >= 80600`.
### `Php73Test::testHardwareTimeAsArrayNanos`
Unrelated, and the reason the `(7.3, apc, apcu, ...)` job failed in the same run: the test asserted `$hrtime2[0] - $hrtime[0] === 0`, which fails whenever the two `hrtime()` calls straddle a whole second. It now measures total elapsed nanoseconds and checks the sub-second component stays in range.
Commits
-------
159e290 Align tests with PHP 8.6 changes to ext/tidy and ext/intl
Copy file name to clipboardExpand all lines: tests/Intl/Normalizer/NormalizerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ public function testNormalizeWithInvalidForm()
97
97
{
98
98
if (80000 <= \PHP_VERSION_ID) {
99
99
$this->expectException(\ValueError::class);
100
-
$this->expectExceptionMessage('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form');
100
+
$this->expectExceptionMessage('normalizer_normalize(): Argument #2 ($form) must be a '.(80600 > \PHP_VERSION_ID ? 'a ' : '').'valid normalization form');
0 commit comments