diff --git a/features/comment-recount.feature b/features/comment-recount.feature index 4a773de68..c9216150f 100644 --- a/features/comment-recount.feature +++ b/features/comment-recount.feature @@ -11,7 +11,14 @@ Feature: Recount comments on a post 3 """ - When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) ); clean_post_cache( 1 );'` + Given a recount-comments.php file: + """ + update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) ); + clean_post_cache( 1 ); + """ + When I run `wp eval-file recount-comments.php` And I run `wp post get 1 --field=comment_count` Then STDOUT should be: """ diff --git a/features/comment.feature b/features/comment.feature index 290954e02..066df5476 100644 --- a/features/comment.feature +++ b/features/comment.feature @@ -289,6 +289,7 @@ Feature: Manage WordPress comments """ And the return code should be 0 + @skip-windows Scenario: Approving/unapproving comments with multidigit comment ID Given I run `wp comment delete $(wp comment list --field=ID)` And I run `wp comment generate --count=10 --quiet` @@ -343,6 +344,7 @@ Feature: Manage WordPress comments """ And the return code should be 0 + @skip-windows Scenario: Spam/unspam comments with multidigit comment ID Given I run `wp comment delete $(wp comment list --field=ID)` And I run `wp comment generate --count=10 --quiet` @@ -392,6 +394,7 @@ Feature: Manage WordPress comments """ And the return code should be 0 + @skip-windows Scenario: Trash/untrash comments with multidigit comment ID Given I run `wp comment delete $(wp comment list --field=ID) --force` And I run `wp comment generate --count=10 --quiet` diff --git a/features/post-block.feature b/features/post-block.feature index 23a760e75..fa3345c1e 100644 --- a/features/post-block.feature +++ b/features/post-block.feature @@ -3,7 +3,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Check if a post has blocks Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post has-blocks {POST_ID}` @@ -12,7 +12,7 @@ Feature: Manage blocks in post content Success: Post {POST_ID} contains blocks. """ - When I run `wp post create --post_title='Classic Post' --post_content='

Hello classic

' --porcelain` + When I run `wp post create --post_title="Classic Post" --post_content="

Hello classic

" --porcelain` Then save STDOUT as {CLASSIC_ID} When I try `wp post has-blocks {CLASSIC_ID}` @@ -25,7 +25,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Check if a post has a specific block Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post has-block {POST_ID} core/paragraph` @@ -50,7 +50,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Parse blocks in a post Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block parse {POST_ID}` @@ -78,7 +78,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: List blocks in a post Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

One

Two

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

One

Two

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block list {POST_ID}` @@ -102,7 +102,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: List nested blocks Given a WP install - When I run `wp post create --post_title='Nested Blocks' --post_content='

Nested

' --porcelain` + When I run `wp post create --post_title="Nested Blocks" --post_content="

Nested

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block list {POST_ID}` @@ -123,7 +123,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Render blocks to HTML Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello World

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello World

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block render {POST_ID}` @@ -163,7 +163,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert a block into a post Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/paragraph --content="Added at end"` @@ -193,7 +193,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert a block with attributes Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/heading --content="Title" --attrs='{"level":3}'` @@ -211,7 +211,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove a block by index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} --index=1` @@ -237,7 +237,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove multiple blocks by indices Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} --index=0,2` @@ -263,7 +263,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove blocks by name Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Para 1

Heading

Para 2

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Para 1

Heading

Para 2

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} core/paragraph` @@ -281,7 +281,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove all blocks of a type Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Para 1

Heading

Para 2

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Para 1

Heading

Para 2

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} core/paragraph --all` @@ -302,7 +302,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace blocks Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Content

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Content

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block replace {POST_ID} core/paragraph core/heading` @@ -323,7 +323,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace all blocks of a type Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Para 1

Para 2

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Para 1

Para 2

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block replace {POST_ID} core/paragraph core/verse --all` @@ -344,7 +344,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace block with new attributes Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block replace {POST_ID} core/heading core/heading --attrs='{"level":4}'` @@ -380,7 +380,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Error handling for remove without block name or index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block remove {POST_ID}` @@ -393,7 +393,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for insert Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/paragraph --content="New" --porcelain` @@ -405,7 +405,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for remove Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} --index=0 --porcelain` @@ -417,7 +417,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for replace Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block replace {POST_ID} core/paragraph core/heading --porcelain` @@ -429,7 +429,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Get a block by index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block get {POST_ID} 0` @@ -467,7 +467,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Error on invalid block index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block get {POST_ID} 5` @@ -487,7 +487,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update block attributes Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"level":3}'` @@ -505,7 +505,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update heading level syncs HTML tag Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Original Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Original Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"level":4}'` @@ -535,7 +535,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update list ordered attribute syncs HTML tag Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"ordered":true}'` @@ -577,7 +577,7 @@ Feature: Manage blocks in post content return $block; }, 10, 3 ); """ - When I run `wp post create --post_title='Block Post' --post_content='

Hello World

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello World

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"customClass":"my-custom-class"}' --require=custom-sync-filter.php` @@ -595,7 +595,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update block content Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Old text

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Old text

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --content="

New text

"` @@ -617,7 +617,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update block with replace-attrs flag Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"level":4}' --replace-attrs` @@ -639,7 +639,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Error when no attrs or content provided for update Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block update {POST_ID} 0` @@ -652,7 +652,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for update Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --content="

New

" --porcelain` @@ -664,7 +664,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Move block forward Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block move {POST_ID} 0 2` @@ -679,7 +679,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Move block backward Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block move {POST_ID} 2 0` @@ -694,7 +694,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Move block same index warning Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block move {POST_ID} 0 0` @@ -707,7 +707,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Error on invalid move indices Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block move {POST_ID} 5 0` @@ -727,7 +727,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for move Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block move {POST_ID} 0 1 --porcelain` @@ -739,7 +739,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export blocks to STDOUT as JSON Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID}` @@ -759,7 +759,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export blocks as YAML Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID} --format=yaml` @@ -779,7 +779,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export blocks as HTML Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello World

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Hello World

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID} --format=html` @@ -797,7 +797,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export blocks to file Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID} --file=blocks-export.json` @@ -822,7 +822,7 @@ Feature: Manage blocks in post content ] } """ - When I run `wp post create --post_title='Block Post' --post_content='

Original

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Original

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=blocks-import.json` @@ -848,7 +848,7 @@ Feature: Manage blocks in post content ] } """ - When I run `wp post create --post_title='Block Post' --post_content='

Second

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Second

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=blocks-import.json --position=start` @@ -871,7 +871,7 @@ Feature: Manage blocks in post content ] } """ - When I run `wp post create --post_title='Block Post' --post_content='

Old

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Old

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=blocks-import.json --replace` @@ -892,7 +892,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Import error on missing file Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block import {POST_ID} --file=nonexistent.json` @@ -914,7 +914,7 @@ Feature: Manage blocks in post content ] } """ - When I run `wp post create --post_title='Block Post' --post_content='' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=blocks-import.json --porcelain` @@ -926,10 +926,10 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count blocks across posts Given a WP install - When I run `wp post create --post_title='Post 1' --post_content='

Test

Test2

' --post_status=publish --porcelain` + When I run `wp post create --post_title="Post 1" --post_content="

Test

Test2

" --post_status=publish --porcelain` Then save STDOUT as {POST_1} - When I run `wp post create --post_title='Post 2' --post_content='

Test

Title

' --post_status=publish --porcelain` + When I run `wp post create --post_title="Post 2" --post_content="

Test

Title

" --post_status=publish --porcelain` Then save STDOUT as {POST_2} When I run `wp post block count {POST_1} {POST_2}` @@ -941,7 +941,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count specific block type Given a WP install - When I run `wp post create --post_title='Post 1' --post_content='

Test

Test2

' --post_status=publish --porcelain` + When I run `wp post create --post_title="Post 1" --post_content="

Test

Test2

" --post_status=publish --porcelain` Then save STDOUT as {POST_1} When I run `wp post block count {POST_1} --block=core/paragraph --format=count` @@ -953,7 +953,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count unique block types Given a WP install - When I run `wp post create --post_title='Post 1' --post_content='

Test

Title

' --post_status=publish --porcelain` + When I run `wp post create --post_title="Post 1" --post_content="

Test

Title

" --post_status=publish --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block count {POST_ID} --format=count` @@ -965,7 +965,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Clone block with default position (after) Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Second

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Second

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block clone {POST_ID} 0` @@ -982,7 +982,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Clone block to end Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block clone {POST_ID} 0 --position=end` @@ -997,7 +997,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Clone block to start Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

First

Title

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

First

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block clone {POST_ID} 1 --position=start` @@ -1012,7 +1012,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Porcelain output for clone Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block clone {POST_ID} 0 --porcelain` @@ -1024,7 +1024,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Error on invalid clone index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Block Post" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block clone {POST_ID} 5` @@ -1037,7 +1037,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract attribute values Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Title 1

Title 2

' --porcelain` + And a block-content.txt file: + """ +

Title 1

Title 2

+ """ + When I run `wp post create block-content.txt --post_title='Block Post' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block extract {POST_ID} --block=core/heading --attr=level --format=ids` @@ -1053,7 +1057,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract attribute from specific index Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Title

' --porcelain` + And a block-content.txt file: + """ +

Title

+ """ + When I run `wp post create block-content.txt --post_title='Block Post' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block extract {POST_ID} --index=0 --attr=level --format=ids` @@ -1065,7 +1073,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract content from blocks Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Hello World

' --porcelain` + And a block-content.txt file: + """ +

Hello World

+ """ + When I run `wp post create block-content.txt --post_title='Block Post' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block extract {POST_ID} --block=core/paragraph --content --format=ids` @@ -1077,7 +1089,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract error when no attr or content specified Given a WP install - When I run `wp post create --post_title='Block Post' --post_content='

Test

' --porcelain` + And a block-content.txt file: + """ +

Test

+ """ + When I run `wp post create block-content.txt --post_title='Block Post' --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block extract {POST_ID}` @@ -1094,7 +1110,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Check for nested block inside group Given a WP install - When I run `wp post create --post_title='Nested' --post_content='

Nested para

' --porcelain` + And a block-content.txt file: + """ +

Nested para

+ """ + When I run `wp post create block-content.txt --post_title='Nested' --porcelain` Then save STDOUT as {POST_ID} # Should find the nested paragraph @@ -1114,7 +1134,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Partial block name does not match Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + And a block-content.txt file: + """ +

Test

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} # "core/para" should NOT match "core/paragraph" @@ -1128,7 +1152,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Parse post with classic content (no blocks) Given a WP install - When I run `wp post create --post_title='Classic' --post_content='

Just HTML, no blocks

' --porcelain` + And a block-content.txt file: + """ +

Just HTML, no blocks

+ """ + When I run `wp post create block-content.txt --post_title='Classic' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block parse {POST_ID}` @@ -1140,7 +1168,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Render dynamic block Given a WP install - When I run `wp post create --post_title='Dynamic' --post_content='' --porcelain` + And a block-content.txt file: + """ + + """ + When I run `wp post create block-content.txt --post_title='Dynamic' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block render {POST_ID}` @@ -1150,7 +1182,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert block at specific numeric position Given a WP install - When I run `wp post create --post_title='Test' --post_content='

First

Third

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

First

Third

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/paragraph --content="Second" --position=1` @@ -1165,7 +1197,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove all blocks from post Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Only block

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Only block

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} --index=0` @@ -1183,7 +1215,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace when no matches found Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block replace {POST_ID} core/image core/heading` @@ -1196,7 +1228,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update with invalid attrs JSON Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Title

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Title

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block update {POST_ID} 0 --attrs='{not valid json'` @@ -1213,7 +1245,7 @@ Feature: Manage blocks in post content """ {not valid json """ - When I run `wp post create --post_title='Test' --post_content='' --porcelain` + When I run `wp post create --post_title="Test" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block import {POST_ID} --file=bad-import.json` @@ -1226,10 +1258,18 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count blocks filtered by post type Given a WP install - When I run `wp post create --post_title='Post' --post_type=post --post_content='

Post

' --post_status=publish --porcelain` + And a block-content-1.txt file: + """ +

Post

+ """ + When I run `wp post create block-content-1.txt --post_title='Post' --post_type=post --post_status=publish --porcelain` Then save STDOUT as {POST_ID} - When I run `wp post create --post_title='Page' --post_type=page --post_content='

Page

' --post_status=publish --porcelain` + And a block-content-2.txt file: + """ +

Page

+ """ + When I run `wp post create block-content-2.txt --post_title='Page' --post_type=page --post_status=publish --porcelain` Then save STDOUT as {PAGE_ID} When I run `wp post block count {POST_ID} --post-type=post` @@ -1245,10 +1285,14 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count blocks filtered by post status Given a WP install - When I run `wp post create --post_title='Published' --post_content='

Pub

' --post_status=publish --porcelain` + And a block-content.txt file: + """ +

Pub

+ """ + When I run `wp post create block-content.txt --post_title='Published' --post_status=publish --porcelain` Then save STDOUT as {PUB_ID} - When I run `wp post create --post_title='Draft' --post_content='

Draft

' --post_status=draft --porcelain` + When I run `wp post create --post_title="Draft" --post_content="

Draft

" --post_status=draft --porcelain` Then save STDOUT as {DRAFT_ID} When I run `wp post block count {DRAFT_ID} --post-status=draft` @@ -1264,7 +1308,7 @@ Feature: Manage blocks in post content Scenario: Post with mixed block and freeform content Given a WP install # Content with blocks and freeform text in between - When I run `wp post create --post_title='Mixed' --post_content='

Block

Some freeform text

Title

' --porcelain` + When I run `wp post create --post_title="Mixed" --post_content="

Block

Some freeform text

Title

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post has-blocks {POST_ID}` @@ -1276,7 +1320,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Empty post has no blocks Given a WP install - When I run `wp post create --post_title='Empty' --post_content='' --porcelain` + When I run `wp post create --post_title="Empty" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post has-blocks {POST_ID}` @@ -1289,7 +1333,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Parse deeply nested blocks Given a WP install - When I run `wp post create --post_title='Deep' --post_content='

Deep

' --porcelain` + And a block-content.txt file: + """ +

Deep

+ """ + When I run `wp post create block-content.txt --post_title='Deep' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block parse {POST_ID}` @@ -1309,7 +1357,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: List blocks on post with no blocks Given a WP install - When I run `wp post create --post_title='Classic' --post_content='

No blocks

' --porcelain` + When I run `wp post create --post_title="Classic" --post_content="

No blocks

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block list {POST_ID} --format=count` @@ -1321,7 +1369,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Render nested blocks Given a WP install - When I run `wp post create --post_title='Nested' --post_content='

Inner

' --porcelain` + And a block-content.txt file: + """ +

Inner

+ """ + When I run `wp post create block-content.txt --post_title='Nested' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block render {POST_ID}` @@ -1333,7 +1385,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert self-closing block Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Before

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Before

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/separator` @@ -1351,7 +1403,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert block into empty post Given a WP install - When I run `wp post create --post_title='Empty' --post_content='' --porcelain` + When I run `wp post create --post_title="Empty" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block insert {POST_ID} core/paragraph --content="First block"` @@ -1369,7 +1421,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove with out of bounds index Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block remove {POST_ID} --index=100` @@ -1382,7 +1434,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove with negative index Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block remove {POST_ID} --index=-1` @@ -1395,7 +1447,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove container block removes children Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Nested

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Nested

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block remove {POST_ID} --index=0` @@ -1413,7 +1465,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove block by index Given a WP install - When I run `wp post create --post_title='Three Blocks' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Three Blocks" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} # Index 1 should be "Second" block @@ -1440,7 +1492,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Remove multiple blocks by indices Given a WP install - When I run `wp post create --post_title='Three Blocks' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Three Blocks" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} # Indices 0 and 2 should be "First" and "Third" @@ -1467,7 +1519,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace block preserves content Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Keep this text

' --porcelain` + And a block-content.txt file: + """ +

Keep this text

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block replace {POST_ID} core/paragraph core/verse` @@ -1485,7 +1541,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Get nested block shows inner blocks Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Inner

' --porcelain` + And a block-content.txt file: + """ +

Inner

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block get {POST_ID} 0` @@ -1501,7 +1561,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Update both attrs and content Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Old Title

' --porcelain` + And a block-content.txt file: + """ +

Old Title

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block update {POST_ID} 0 --attrs='{"level":3}' --content="

New Title

"` @@ -1525,7 +1589,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Move in single block post Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Only

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Only

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block move {POST_ID} 0 1` @@ -1538,7 +1602,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export with --raw includes innerHTML Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test content

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test content

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID} --raw` @@ -1554,7 +1618,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Export post with no blocks Given a WP install - When I run `wp post create --post_title='Classic' --post_content='

No blocks

' --porcelain` + When I run `wp post create --post_title="Classic" --post_content="

No blocks

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block export {POST_ID}` @@ -1570,7 +1634,7 @@ Feature: Manage blocks in post content """ {"blocks":[{"blockName":"core/heading","attrs":{"level":2},"innerBlocks":[],"innerHTML":"

Middle

","innerContent":["

Middle

"]}]} """ - When I run `wp post create --post_title='Test' --post_content='

First

Last

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

First

Last

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=blocks-import-pos.json --position=1` @@ -1585,7 +1649,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Clone block to specific numeric position Given a WP install - When I run `wp post create --post_title='Test' --post_content='

First

Second

Third

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

First

Second

Third

" --porcelain` Then save STDOUT as {POST_ID} # Clone first block to position 2 (between Second and Third) @@ -1601,7 +1665,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Clone nested block preserves children Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Inner

' --porcelain` + And a block-content.txt file: + """ +

Inner

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block clone {POST_ID} 0` @@ -1619,7 +1687,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract non-existent attribute Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block extract {POST_ID} --block=core/paragraph --attr=nonexistent --format=ids` @@ -1631,7 +1699,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract from non-existent block type Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block extract {POST_ID} --block=core/image --attr=id --format=ids` @@ -1647,7 +1715,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Parse empty post content Given a WP install - When I run `wp post create --post_title='Empty' --post_content='' --porcelain` + When I run `wp post create --post_title="Empty" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block parse {POST_ID}` @@ -1659,7 +1727,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: List blocks in CSV and YAML formats Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block list {POST_ID} --format=csv` @@ -1681,7 +1749,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: List with --nested counts all nesting levels Given a WP install - When I run `wp post create --post_title='Deep' --post_content='

Deep

' --porcelain` + And a block-content.txt file: + """ +

Deep

+ """ + When I run `wp post create block-content.txt --post_title='Deep' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block list {POST_ID} --nested` @@ -1693,7 +1765,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Render unknown block type Given a WP install - When I run `wp post create --post_title='Unknown' --post_content='

Content

' --porcelain` + When I run `wp post create --post_title="Unknown" --post_content="

Content

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block render {POST_ID}` @@ -1706,7 +1778,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Insert with invalid attrs JSON Given a WP install - When I run `wp post create --post_title='Test' --post_content='' --porcelain` + When I run `wp post create --post_title="Test" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block insert {POST_ID} core/heading --attrs='{invalid json'` @@ -1719,7 +1791,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Replace with invalid attrs JSON Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block replace {POST_ID} core/paragraph core/heading --attrs='{broken'` @@ -1732,7 +1804,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Move with negative indices Given a WP install - When I run `wp post create --post_title='Test' --post_content='

First

Second

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

First

Second

" --porcelain` Then save STDOUT as {POST_ID} When I try `wp post block move {POST_ID} -1 0` @@ -1745,7 +1817,7 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Count blocks in various formats Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Test

' --post_status=publish --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Test

" --post_status=publish --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block count {POST_ID} --format=json` @@ -1773,7 +1845,7 @@ Feature: Manage blocks in post content """ {"version":"1.0","blocks":[]} """ - When I run `wp post create --post_title='Test' --post_content='

Existing

' --porcelain` + When I run `wp post create --post_title="Test" --post_content="

Existing

" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID} --file=empty-blocks.json` @@ -1785,7 +1857,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract attribute in various formats Given a WP install - When I run `wp post create --post_title='Test' --post_content='

One

Two

' --porcelain` + And a block-content.txt file: + """ +

One

Two

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block extract {POST_ID} --block=core/heading --attr=level --format=json` @@ -1803,7 +1879,11 @@ Feature: Manage blocks in post content @require-wp-5.0 Scenario: Extract with both block and index filters Given a WP install - When I run `wp post create --post_title='Test' --post_content='

Para

Title

' --porcelain` + And a block-content.txt file: + """ +

Para

Title

+ """ + When I run `wp post create block-content.txt --post_title='Test' --porcelain` Then save STDOUT as {POST_ID} # --index=1 is the heading, --block filter should match @@ -1824,7 +1904,7 @@ Feature: Manage blocks in post content """ {"blocks":[{"blockName":"core/paragraph","attrs":{},"innerBlocks":[],"innerHTML":"

From STDIN

","innerContent":["

From STDIN

"]}]} """ - When I run `wp post create --post_title='STDIN Test' --post_content='' --porcelain` + When I run `wp post create --post_title="STDIN Test" --post_content="" --porcelain` Then save STDOUT as {POST_ID} When I run `wp post block import {POST_ID}` with STDIN from 'blocks-stdin.json' diff --git a/features/post-meta.feature b/features/post-meta.feature index 9ee715387..2a1eb7468 100644 --- a/features/post-meta.feature +++ b/features/post-meta.feature @@ -1,5 +1,7 @@ Feature: Manage post custom fields + # Windos likes to include the quotes of the `"via STDIN"` string. + @skip-windows Scenario: Postmeta CRUD Given a WP install @@ -34,7 +36,7 @@ Feature: Manage post custom fields ["1","2"] """ - When I run `echo 'via STDIN' | wp post-meta set 1 foo` + When I run `echo "via STDIN" | wp post-meta set 1 foo` And I run `wp post-meta get 1 foo` Then STDOUT should be: """ diff --git a/features/post.feature b/features/post.feature index 5c7f06a67..f72cbd652 100644 --- a/features/post.feature +++ b/features/post.feature @@ -224,7 +224,7 @@ Feature: Manage WordPress posts """ And a create-post.sh file: """ - cat content.html | wp post create --post_title='Test post' --post_excerpt="A multiline + cat content.html | wp post create --post_title="Test post" --post_excerpt="A multiline excerpt" --porcelain - """ @@ -265,14 +265,14 @@ Feature: Manage WordPress posts } """ - When I try `EDITOR='ex -i NONE -c q!' wp post edit {POST_ID}` + When I try `EDITOR="ex -i NONE -c q!" wp post edit {POST_ID}` Then STDERR should contain: """ No change made to post content. """ And the return code should be 0 - When I run `EDITOR='ex -i NONE -c %s/content/bunkum -c wq' wp post edit {POST_ID}` + When I run `EDITOR="ex -i NONE -c %s/content/bunkum -c wq" wp post edit {POST_ID}` Then STDERR should be empty And STDOUT should contain: """ @@ -473,7 +473,7 @@ Feature: Manage WordPress posts My\Post """ - When I run `wp post update {POST_ID} --post_content='var isEmailValid = /^\S+@\S+.\S+$/.test(email);'` + When I run `wp post update {POST_ID} --post_content="var isEmailValid = /^\S+@\S+.\S+$/.test(email);"` Then STDOUT should not be empty When I run `wp post get {POST_ID} --field=content` diff --git a/features/site.feature b/features/site.feature index a9e098690..8e626db35 100644 --- a/features/site.feature +++ b/features/site.feature @@ -38,6 +38,7 @@ Feature: Manage sites in a multisite installation http://first.example.com """ + @skip-windows Scenario: Delete a site by id Given a WP multisite subdirectory install @@ -77,6 +78,7 @@ Feature: Manage sites in a multisite installation When I try the previous command again Then the return code should be 1 + @skip-windows Scenario: Filter site list Given a WP multisite install @@ -212,6 +214,7 @@ Feature: Manage sites in a multisite installation """ And the return code should be 1 + @skip-windows Scenario: Get site info Given a WP multisite install diff --git a/features/term-recount.feature b/features/term-recount.feature index c7442aec0..ca2edccf2 100644 --- a/features/term-recount.feature +++ b/features/term-recount.feature @@ -40,7 +40,14 @@ Feature: Recount terms on a taxonomy """ 1 """ - When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->term_taxonomy, array( "count" => 3 ), array( "term_id" => {TERM_ID} ) ); clean_term_cache( {TERM_ID}, "category" );'` + Given a recount-terms.php file: + """ + update( $wpdb->term_taxonomy, array( "count" => 3 ), array( "term_id" => {TERM_ID} ) ); + clean_term_cache( {TERM_ID}, "category" ); + """ + When I run `wp eval-file recount-terms.php` And I run `wp term get category {TERM_ID} --field=count` Then STDOUT should be: """ diff --git a/features/term.feature b/features/term.feature index 574d11219..97655db6e 100644 --- a/features/term.feature +++ b/features/term.feature @@ -181,7 +181,7 @@ Feature: Manage WordPress terms My\Term\Description """ - When I run `wp term update category {TERM_ID} --name='My\New\Term' --description='var isEmailValid = /^\S+@\S+.\S+$/.test(email);'` + When I run `wp term update category {TERM_ID} --name="My\New\Term" --description="var isEmailValid = /^\S+@\S+.\S+$/.test(email);"` Then STDOUT should not be empty When I run `wp term get category {TERM_ID} --field=name` diff --git a/features/user-application-password.feature b/features/user-application-password.feature index eb8fcb309..507b7ee28 100644 --- a/features/user-application-password.feature +++ b/features/user-application-password.feature @@ -271,10 +271,15 @@ Feature: Manage user custom fields When I run `wp user application-password list {USER_ID} --name=someapp --field=uuid` Then save STDOUT as {UUID} - When I run `wp user application-password get {USER_ID} {UUID} --field=password | sed 's/\$/\\\$/g'` + When I run `wp user application-password get {USER_ID} {UUID} --field=password` Then save STDOUT as {HASH} - When I run `wp eval "var_export( wp_check_password( '{PASSWORD}', '{HASH}', {USER_ID} ) );"` + Given a check-password.php file: + """ + getRealPath(); // Don't clobber subsites when operating on the main site - if ( $is_main_site && false !== stripos( $realpath, '/sites/' ) ) { + $normalized_realpath = str_replace( '\\', '/', $realpath ); + if ( $is_main_site && false !== stripos( $normalized_realpath, '/sites/' ) ) { continue; } if ( $fileinfo->isDir() ) {