Skip to content

Commit 224b59b

Browse files
authored
Make Behat scenarios SQLite-compatible (#138)
1 parent ddbf8c0 commit 224b59b

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

features/export.feature

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Feature: Export content.
4040
"""
4141
And the return code should be 1
4242

43-
@require-wp-5.2 @require-mysql
43+
@require-wp-5.2
4444
Scenario: Export with post_type and post_status argument
4545
Given a WP install
4646

@@ -79,7 +79,7 @@ Feature: Export content.
7979
10
8080
"""
8181

82-
@require-wp-5.2 @require-mysql
82+
@require-wp-5.2
8383
Scenario: Export a comma-separated list of post types
8484
Given a WP install
8585

@@ -132,7 +132,7 @@ Feature: Export content.
132132
10
133133
"""
134134

135-
@require-wp-5.2 @require-mysql
135+
@require-wp-5.2
136136
Scenario: Export only one post
137137
Given a WP install
138138

@@ -203,7 +203,7 @@ Feature: Export content.
203203
2
204204
"""
205205

206-
@require-wp-5.2 @require-mysql
206+
@require-wp-5.2
207207
Scenario: Export multiple posts, separated by spaces
208208
Given a WP install
209209

@@ -236,7 +236,7 @@ Feature: Export content.
236236
2
237237
"""
238238

239-
@require-wp-5.2 @require-mysql
239+
@require-wp-5.2
240240
Scenario: Export multiple posts, separated by comma
241241
Given a WP install
242242

@@ -269,7 +269,7 @@ Feature: Export content.
269269
2
270270
"""
271271

272-
@require-wp-5.2 @require-mysql
272+
@require-wp-5.2
273273
Scenario: Export posts within a given date range
274274
Given a WP install
275275

@@ -310,7 +310,7 @@ Feature: Export content.
310310
10
311311
"""
312312

313-
@require-wp-5.2 @require-mysql
313+
@require-wp-5.2
314314
Scenario: Export posts from a given category
315315
Given a WP install
316316
And I run `wp site empty --yes`
@@ -392,7 +392,7 @@ Feature: Export content.
392392
Apple Post
393393
"""
394394

395-
@require-wp-5.2 @require-mysql
395+
@require-wp-5.2
396396
Scenario: Export posts from a given author
397397
Given a WP install
398398
And I run `wp site empty --yes`
@@ -475,7 +475,7 @@ Feature: Export content.
475475
john.doe@example.com
476476
"""
477477

478-
@require-wp-5.2 @require-mysql
478+
@require-wp-5.2
479479
Scenario: Export posts should include user information
480480
Given a WP install
481481
And I run `wp plugin install wordpress-importer --activate`
@@ -502,7 +502,7 @@ Feature: Export content.
502502
Test User
503503
"""
504504

505-
@require-wp-5.2 @require-mysql
505+
@require-wp-5.2
506506
Scenario: Export posts from a given starting post ID
507507
Given a WP install
508508

@@ -520,7 +520,11 @@ Feature: Export content.
520520
10
521521
"""
522522

523-
When I run `wp export --start_id=6`
523+
# 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.
524+
When I run `wp post list --post_type=post --orderby=ID --order=ASC --posts_per_page=1 --offset=5 --format=ids`
525+
Then save STDOUT as {START_ID}
526+
527+
When I run `wp export --start_id={START_ID}`
524528
Then save STDOUT 'Writing to file %s' as {EXPORT_FILE}
525529

526530
When I run `wp site empty --yes`
@@ -541,7 +545,7 @@ Feature: Export content.
541545
5
542546
"""
543547

544-
@require-wp-5.2 @require-mysql
548+
@require-wp-5.2
545549
Scenario: Exclude a specific post type from export
546550
Given a WP install
547551
And I run `wp site empty --yes`
@@ -604,7 +608,7 @@ Feature: Export content.
604608
0
605609
"""
606610

607-
@require-mysql
611+
608612
Scenario: Export posts using --max_num_posts
609613
Given a WP install
610614
And I run `wp site empty --yes`
@@ -662,7 +666,7 @@ Feature: Export content.
662666
thisisaverylongsitenamethatexceedsfiftycharactersandshouldbetruncated
663667
"""
664668

665-
@require-wp-5.2 @require-mysql
669+
@require-wp-5.2
666670
Scenario: Export a site and skip the comments
667671
Given a WP install
668672
And I run `wp comment generate --post_id=1 --count=2`
@@ -843,7 +847,7 @@ Feature: Export content.
843847
"""
844848
And STDERR should be empty
845849

846-
@require-wp-5.2 @require-mysql
850+
@require-wp-5.2
847851
Scenario: Export a site to stdout
848852
Given a WP install
849853
And I run `wp comment generate --post_id=1 --count=1`
@@ -897,7 +901,7 @@ Feature: Export content.
897901
"""
898902
And the return code should be 1
899903

900-
@require-wp-5.2 @require-mysql
904+
@require-wp-5.2
901905
Scenario: Export individual post with attachments
902906
Given a WP install
903907
And I run `wp plugin install wordpress-importer --activate`
@@ -989,7 +993,7 @@ Feature: Export content.
989993
white-150-square.jpg";s:
990994
"""
991995

992-
@require-wp-5.2 @require-mysql
996+
@require-wp-5.2
993997
Scenario: Export categories, tags and terms
994998
Given a WP install
995999
And a wp-content/mu-plugins/register-region-taxonomy.php file:
@@ -1154,7 +1158,7 @@ Feature: Export content.
11541158
Europe
11551159
"""
11561160

1157-
@require-wp-5.2 @require-mysql
1161+
@require-wp-5.2
11581162
Scenario: Export posts should not include oembed_cache posts user information
11591163
Given a WP install
11601164
And I run `wp plugin install wordpress-importer --activate`
@@ -1186,7 +1190,7 @@ Feature: Export content.
11861190
Test User
11871191
"""
11881192

1189-
@require-wp-5.2 @require-mysql
1193+
@require-wp-5.2
11901194
Scenario: Allow export to proceed when orphaned terms are found
11911195
Given a WP install
11921196
And I run `wp term create category orphan --parent=1`
@@ -1241,7 +1245,7 @@ Feature: Export content.
12411245
0
12421246
"""
12431247

1244-
@require-mysql
1248+
12451249
Scenario: Throw exception when orphaned terms are found
12461250
Given a WP install
12471251
And I run `wp term create category orphan --parent=1`
@@ -1281,7 +1285,7 @@ Feature: Export content.
12811285
<wp:tag>
12821286
"""
12831287

1284-
@require-wp-5.2 @require-mysql
1288+
@require-wp-5.2
12851289
Scenario: Export posts with future status
12861290
Given a WP install
12871291
And I run `wp plugin install wordpress-importer --activate`

0 commit comments

Comments
 (0)