File tree Expand file tree Collapse file tree 1 file changed +24
-8
lines changed
Expand file tree Collapse file tree 1 file changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -396,14 +396,6 @@ Feature: Do global search/replace
396396 https://example.com
397397 """
398398
399- 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:
401- """
402- Error: The regex '1HTTPS://EXAMPLE.COM1i' fails.
403- preg_match(): Delimiter must not be alphanumeric or backslash.
404- """
405- And the return code should be 1
406-
407399 When I try `wp search-replace 'regex error)' '' --regex`
408400 Then STDERR should contain:
409401 """
@@ -464,6 +456,30 @@ Feature: Do global search/replace
464456 """
465457 And the return code should be 1
466458
459+ @less-than-php-8.2
460+ Scenario : Search replace with an invalid regex delimiter
461+ Given a WP install
462+
463+ 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:
477+ """
478+ Error: The regex '1HTTPS://EXAMPLE.COM1i' fails.
479+ preg_match(): Delimiter must not be alphanumeric, backslash, or NUL.
480+ """
481+ And the return code should be 1
482+
467483 Scenario : Formatting as count-only
468484 Given a WP install
469485 And I run `wp option set foo 'ALPHA.example.com' `
You can’t perform that action at this time.
0 commit comments