Skip to content

Commit b1671b5

Browse files
Use single test that works for all tested PHP versions
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
1 parent cbfbaf7 commit b1671b5

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

features/search-replace.feature

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -456,30 +456,17 @@ Feature: Do global search/replace
456456
"""
457457
And the return code should be 1
458458

459-
@less-than-php-8.2
460459
Scenario: Search replace with an invalid regex delimiter
461460
Given a WP install
462461

462+
# Exact preg_match() error changed with PHP 8.2+ (added NUL).
463463
When I try `wp search-replace 'HTTPS://EXAMPLE.COM' 'https://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='1'`
464-
Then STDERR should be:
465-
"""
466-
Error: The regex '1HTTPS://EXAMPLE.COM1i' fails.
467-
preg_match(): Delimiter must not be alphanumeric or backslash.
468-
"""
469-
And the return code should be 1
470-
471-
@require-php-8.2
472-
Scenario: Search replace with an invalid regex delimiter
473-
Given a WP install
474-
475-
When I try `wp search-replace 'HTTPS://EXAMPLE.COM' 'https://example.jp/' wp_options --regex --regex-flags=i --regex-delimiter='1'`
476-
Then STDERR should be:
464+
Then STDERR should contain:
477465
"""
478466
Error: The regex '1HTTPS://EXAMPLE.COM1i' fails.
479-
preg_match(): Delimiter must not be alphanumeric, backslash, or NUL.
467+
preg_match(): Delimiter must not be alphanumeric
480468
"""
481469
And the return code should be 1
482-
483470
Scenario: Formatting as count-only
484471
Given a WP install
485472
And I run `wp option set foo 'ALPHA.example.com'`

0 commit comments

Comments
 (0)