From 093947e5fb1ef436fc1bc506b148b230bd2ea6a2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 23:16:17 +0100 Subject: [PATCH 1/6] Tests: further Windows compatibility fixes --- features/comment-recount.feature | 9 +- features/post-block.feature | 160 ++++++++++----------- features/term-recount.feature | 9 +- features/user-application-password.feature | 18 ++- 4 files changed, 110 insertions(+), 86 deletions(-) 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/post-block.feature b/features/post-block.feature index 23a760e75..f5b94e18f 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` @@ -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` @@ -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` @@ -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` @@ -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

"` @@ -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` @@ -1150,7 +1150,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 +1165,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 +1183,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 +1196,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 +1213,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,7 +1226,7 @@ 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` + When I run `wp post create --post_title="Post" --post_type=post --post_content="

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` @@ -1248,7 +1248,7 @@ Feature: Manage blocks in post content When I run `wp post create --post_title='Published' --post_content='

Pub

' --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 +1264,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 +1276,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}` @@ -1309,7 +1309,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` @@ -1333,7 +1333,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 +1351,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 +1369,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 +1382,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 +1395,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 +1413,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 +1440,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" @@ -1525,7 +1525,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 +1538,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 +1554,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 +1570,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 +1585,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) @@ -1619,7 +1619,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 +1631,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 +1647,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 +1659,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` @@ -1693,7 +1693,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 +1706,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 +1719,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 +1732,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 +1745,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 +1773,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` @@ -1824,7 +1824,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/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/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: + """ + Date: Sun, 29 Mar 2026 16:00:30 +0200 Subject: [PATCH 2/6] skip some tests --- features/comment.feature | 3 +++ features/site.feature | 3 +++ features/user-import-csv.feature | 1 + 3 files changed, 7 insertions(+) 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/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/user-import-csv.feature b/features/user-import-csv.feature index aa610436f..a0098e6f3 100644 --- a/features/user-import-csv.feature +++ b/features/user-import-csv.feature @@ -103,6 +103,7 @@ Feature: Import users from CSV } """ + @skip-windows Scenario: Import users from a CSV file generated by `wp user list` Given a WP install From a1b7912b4f1f1d0f663d12fe833181266a2bc81f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 29 Mar 2026 16:00:39 +0200 Subject: [PATCH 3/6] normalize path --- src/Site_Command.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Site_Command.php b/src/Site_Command.php index 4874f43cb..5a231d7a9 100644 --- a/src/Site_Command.php +++ b/src/Site_Command.php @@ -247,7 +247,8 @@ public function empty_( $args, $assoc_args ) { foreach ( $files as $fileinfo ) { $realpath = $fileinfo->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() ) { From 809d3860734e2111db6cd729a0cb1f3d853f06c3 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sun, 29 Mar 2026 16:00:47 +0200 Subject: [PATCH 4/6] use double quotes --- features/post-block.feature | 12 ++++++------ features/term.feature | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/features/post-block.feature b/features/post-block.feature index f5b94e18f..943a993e2 100644 --- a/features/post-block.feature +++ b/features/post-block.feature @@ -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}` @@ -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}'` @@ -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` @@ -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}'` @@ -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` 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` From 83e2c428b2db5eee61072750af7fb2e044b7d47d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 1 Apr 2026 15:08:54 +0200 Subject: [PATCH 5/6] Fix some quotes --- features/post-block.feature | 78 ++++++++++++++++++++++++++++++------- features/post-meta.feature | 2 +- features/post.feature | 4 +- 3 files changed, 68 insertions(+), 16 deletions(-) diff --git a/features/post-block.feature b/features/post-block.feature index 943a993e2..90aa5c7d3 100644 --- a/features/post-block.feature +++ b/features/post-block.feature @@ -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" @@ -1226,10 +1250,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,7 +1277,11 @@ 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` @@ -1601,7 +1637,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` @@ -1681,7 +1721,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` @@ -1785,7 +1829,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 +1851,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 diff --git a/features/post-meta.feature b/features/post-meta.feature index 9ee715387..b8296018b 100644 --- a/features/post-meta.feature +++ b/features/post-meta.feature @@ -34,7 +34,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..5c77f7731 100644 --- a/features/post.feature +++ b/features/post.feature @@ -265,7 +265,7 @@ 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. @@ -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` From 286fec8101d10aa58e7651c0f73f1b2a86af5a1d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 1 Apr 2026 18:43:37 +0200 Subject: [PATCH 6/6] More quotes --- features/post-block.feature | 42 ++++++++++++++++++++++++++++++------- features/post-meta.feature | 2 ++ features/post.feature | 4 ++-- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/features/post-block.feature b/features/post-block.feature index 90aa5c7d3..fa3345c1e 100644 --- a/features/post-block.feature +++ b/features/post-block.feature @@ -1152,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}` @@ -1164,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}` @@ -1325,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}` @@ -1357,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}` @@ -1503,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` @@ -1521,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` @@ -1537,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

"` diff --git a/features/post-meta.feature b/features/post-meta.feature index b8296018b..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 diff --git a/features/post.feature b/features/post.feature index 5c77f7731..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 - """ @@ -272,7 +272,7 @@ Feature: Manage WordPress posts """ 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: """