Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions features/export.feature
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Feature: Export content.
Test User
"""

@require-wp-5.2 @require-mysql
@require-wp-5.2
Scenario: Export posts from a given starting post ID
Given a WP install

Expand All @@ -520,7 +520,11 @@ Feature: Export content.
10
"""

When I run `wp export --start_id=6`
# Read the 6th post's ID instead of hardcoding --start_id=6. SQLite does not reset auto-increment on `wp site empty`, so generated IDs aren't always 1..10.
When I run `wp post list --post_type=post --orderby=ID --order=ASC --posts_per_page=1 --offset=5 --format=ids`
Then save STDOUT as {START_ID}

When I run `wp export --start_id={START_ID}`
Then save STDOUT 'Writing to file %s' as {EXPORT_FILE}

When I run `wp site empty --yes`
Expand Down Expand Up @@ -801,14 +805,10 @@ Feature: Export content.
<wp:tag>
"""

@require-mysql
Scenario: Export without splitting the dump
Given a WP install
# Make export file > 15MB so will split by default. Need to split into 4 * 4MB to stay below 10% of default redo log size of 48MB, otherwise get MySQL error.
And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"`
And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"`
And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"`
And I run `wp db query "INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (1, '_dummy', REPEAT( 'A', 4 * 1024 * 1024 ) );"`
# Make export file > 15MB so will split by default. Need to split into 4 * 4MB to stay below 10% of default redo log size of 48MB, otherwise get MySQL error. Use `wp eval` + `str_repeat` because SQLite has no REPEAT() function. All four rows go through a single `wp eval` to avoid four WordPress bootstraps.
And I run `wp eval "update_post_meta(1, '_dummy_0', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_1', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_2', str_repeat('A', 4 * 1024 * 1024)); update_post_meta(1, '_dummy_3', str_repeat('A', 4 * 1024 * 1024));"`

When I run `wp export`
Then STDOUT should contain:
Expand Down
Loading