Skip to content

Commit 5c54825

Browse files
authored
Merge pull request #181 from brandonpayton/fix-regex-invalid-delimiter-test-for-php-8-2
2 parents 6b195e3 + 536a527 commit 5c54825

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

features/search-replace.feature

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,16 @@ Feature: Do global search/replace
396396
https://example.com
397397
"""
398398

399+
# NOTE: The preg_match() error message is a substring of the actual message that matches across supported PHP versions.
400+
# In PHP 8.2, the error message changed from
401+
# "preg_match(): Delimiter must not be alphanumeric or backslash."
402+
# to
403+
# "preg_match(): Delimiter must not be alphanumeric, backslash, or NUL"
399404
When I try `wp search-replace 'HTTPS://EXAMPLE.COM' 'https://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='1'`
400-
Then STDERR should be:
405+
Then STDERR should contain:
401406
"""
402407
Error: The regex '1HTTPS://EXAMPLE.COM1i' fails.
403-
preg_match(): Delimiter must not be alphanumeric or backslash.
408+
preg_match(): Delimiter must not be alphanumeric
404409
"""
405410
And the return code should be 1
406411

0 commit comments

Comments
 (0)