From e6ed2eb4b070aef6f3fba295c6a70dd110219632 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 12:27:21 +0000 Subject: [PATCH 1/7] Initial plan From fbce78fd99df7f8f58f5ad0d7062f70a1ea7197c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Feb 2026 12:30:16 +0000 Subject: [PATCH 2/7] Add HTTP request mocking for audio.com URLs in tests Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com> --- features/add-oembed-provider.feature | 54 ++++++++++++++++++++++++++++ features/provider.feature | 54 ++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/features/add-oembed-provider.feature b/features/add-oembed-provider.feature index 4ccfdde..0ed7223 100644 --- a/features/add-oembed-provider.feature +++ b/features/add-oembed-provider.feature @@ -128,6 +128,24 @@ Feature: Register and use custom oEmbed providers @require-wp-4.0 Scenario: Match an oEmbed provider + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + # Provider not requiring discovery When I run `wp embed provider match https://www.youtube.com/watch?v=dQw4w9WgXcQ` Then STDOUT should contain: @@ -196,6 +214,24 @@ Feature: Register and use custom oEmbed providers # Depends on `oembed_remote_get_args` filter introduced in WP 4.0 https://core.trac.wordpress.org/ticket/23442 @require-wp-4.0 Scenario: Discover a provider with limited response size + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + When I run `wp embed provider match https://audio.com/audio-com/collections/ambient-focus` Then save STDOUT as {DEFAULT_STDOUT} @@ -243,6 +279,24 @@ Feature: Register and use custom oEmbed providers @require-wp-4.0 Scenario: Only match an oEmbed provider if discover + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + When I try `wp embed provider match https://audio.com/audio-com/collections/ambient-focus --no-discover` Then the return code should be 1 And STDERR should be: diff --git a/features/provider.feature b/features/provider.feature index 6615048..ec93c80 100644 --- a/features/provider.feature +++ b/features/provider.feature @@ -129,6 +129,24 @@ Feature: Manage oEmbed providers. @require-wp-4.0 Scenario: Match an oEmbed provider + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + # Provider not requiring discovery When I run `wp embed provider match https://www.youtube.com/watch?v=dQw4w9WgXcQ` Then STDOUT should contain: @@ -197,6 +215,24 @@ Feature: Manage oEmbed providers. # Depends on `oembed_remote_get_args` filter introduced in WP 4.0 https://core.trac.wordpress.org/ticket/23442 @require-wp-4.0 Scenario: Discover a provider with limited response size + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + When I run `wp embed provider match https://audio.com/audio-com/collections/ambient-focus` Then save STDOUT as {DEFAULT_STDOUT} @@ -244,6 +280,24 @@ Feature: Manage oEmbed providers. @require-wp-4.0 Scenario: Only match an oEmbed provider if discover + # Mock the audio.com URL to return HTML with oEmbed discovery links + Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: + """ + HTTP/1.1 200 + Content-Type: text/html + + + + + + + + +

Ambient Focus Collection

+ + + """ + When I try `wp embed provider match https://audio.com/audio-com/collections/ambient-focus --no-discover` Then the return code should be 1 And STDERR should be: From 9bcd82a6e7fd72518f6270f51715f462e3fa7db2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 11 Feb 2026 14:04:27 +0100 Subject: [PATCH 3/7] Remove now obsolete Behat tags --- features/add-oembed-provider.feature | 4 ---- features/fetch.feature | 20 -------------------- features/provider.feature | 3 --- 3 files changed, 27 deletions(-) diff --git a/features/add-oembed-provider.feature b/features/add-oembed-provider.feature index 0ed7223..28227ee 100644 --- a/features/add-oembed-provider.feature +++ b/features/add-oembed-provider.feature @@ -126,7 +126,6 @@ Feature: Register and use custom oEmbed providers When I run `wp embed provider list --field=regex` Then STDOUT should match /^(?:(?:1|0)\n)+$/ - @require-wp-4.0 Scenario: Match an oEmbed provider # Mock the audio.com URL to return HTML with oEmbed discovery links Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: @@ -211,8 +210,6 @@ Feature: Register and use custom oEmbed providers json """ - # Depends on `oembed_remote_get_args` filter introduced in WP 4.0 https://core.trac.wordpress.org/ticket/23442 - @require-wp-4.0 Scenario: Discover a provider with limited response size # Mock the audio.com URL to return HTML with oEmbed discovery links Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: @@ -277,7 +274,6 @@ Feature: Register and use custom oEmbed providers """ And STDOUT should be empty - @require-wp-4.0 Scenario: Only match an oEmbed provider if discover # Mock the audio.com URL to return HTML with oEmbed discovery links Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with: diff --git a/features/fetch.feature b/features/fetch.feature index 68ef353..1bdcd32 100644 --- a/features/fetch.feature +++ b/features/fetch.feature @@ -3,7 +3,6 @@ Feature: Manage oEmbed fetch. Background: Given a WP install - @require-wp-4.0 Scenario: Get HTML embed code for a given URL # Known provider not requiring discovery. When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500` @@ -77,8 +76,6 @@ Feature: Manage oEmbed fetch.