Skip to content

Commit

Permalink
Merge pull request #192 from MarkBerube/search_replace_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera authored Dec 19, 2023
2 parents 0b662a3 + da1acc7 commit 88c9f23
Show file tree
Hide file tree
Showing 4 changed files with 278 additions and 85 deletions.
9 changes: 9 additions & 0 deletions features/search-replace-export.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Feature: Search / replace with file export

@require-mysql
Scenario: Search / replace export to STDOUT
Given a WP install
And I run `echo ' '`
Expand Down Expand Up @@ -76,6 +77,7 @@ Feature: Search / replace with file export
https://example.net
"""

@require-mysql
Scenario: Search / replace export to file
Given a WP install
And I run `wp post generate --count=100`
Expand Down Expand Up @@ -129,6 +131,7 @@ Feature: Search / replace with file export
101
"""

@require-mysql
Scenario: Search / replace export to file with verbosity
Given a WP install

Expand All @@ -151,6 +154,7 @@ Feature: Search / replace with file export
Error: You cannot supply --dry-run and --export at the same time.
"""

@require-mysql
Scenario: Search / replace shouldn't affect primary key
Given a WP install
And I run `wp post create --post_title=foo --porcelain`
Expand Down Expand Up @@ -191,6 +195,7 @@ Feature: Search / replace with file export
Error: Unable to open export file "foo/bar.sql" for writing:
"""

@require-mysql
Scenario: Search / replace specific table
Given a WP install

Expand Down Expand Up @@ -225,6 +230,7 @@ Feature: Search / replace with file export
foo
"""

@require-mysql
Scenario: Search / replace export should cater for field/table names that use reserved words or unusual characters
Given a WP install
# Unlike search-replace.features version, don't use `back``tick` column name as WP_CLI\Iterators\Table::build_fields() can't handle it.
Expand Down Expand Up @@ -268,6 +274,7 @@ Feature: Search / replace with file export
"""
And STDERR should be empty

@require-mysql
Scenario: Suppress report or only report changes on export to file
Given a WP install

Expand Down Expand Up @@ -365,6 +372,7 @@ Feature: Search / replace with file export
"""
And STDERR should be empty

@require-mysql
Scenario: Search / replace should remove placeholder escape on export
Given a WP install
And I run `wp post create --post_title=test-remove-placeholder-escape% --porcelain`
Expand All @@ -380,6 +388,7 @@ Feature: Search / replace with file export
'test-remove-placeholder-escape{'
"""

@require-mysql
Scenario: NULLs exported as NULL and not null string
Given a WP install
And I run `wp db query "INSERT INTO wp_postmeta VALUES (9999, 9999, NULL, 'foo')"`
Expand Down
Loading

0 comments on commit 88c9f23

Please sign in to comment.