@@ -128,6 +128,24 @@ Feature: Register and use custom oEmbed providers
128128
129129 @require-wp-4.0
130130 Scenario : Match an oEmbed provider
131+ # Mock the audio.com URL to return HTML with oEmbed discovery links
132+ Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with:
133+ """
134+ HTTP/1.1 200
135+ Content-Type: text/html
136+
137+ <!DOCTYPE html>
138+ <html>
139+ <head>
140+ <link rel="alternate" type="application/json+oembed" href="https://audio.com/oembed?format=json&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
141+ <link rel="alternate" type="text/xml+oembed" href="https://audio.com/oembed?format=xml&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
142+ </head>
143+ <body>
144+ <h1>Ambient Focus Collection</h1>
145+ </body>
146+ </html>
147+ """
148+
131149 # Provider not requiring discovery
132150 When I run `wp embed provider match https://www.youtube.com/watch?v=dQw4w9WgXcQ`
133151 Then STDOUT should contain:
@@ -196,6 +214,24 @@ Feature: Register and use custom oEmbed providers
196214 # Depends on `oembed_remote_get_args` filter introduced in WP 4.0 https://core.trac.wordpress.org/ticket/23442
197215 @require-wp-4.0
198216 Scenario : Discover a provider with limited response size
217+ # Mock the audio.com URL to return HTML with oEmbed discovery links
218+ Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with:
219+ """
220+ HTTP/1.1 200
221+ Content-Type: text/html
222+
223+ <!DOCTYPE html>
224+ <html>
225+ <head>
226+ <link rel="alternate" type="application/json+oembed" href="https://audio.com/oembed?format=json&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
227+ <link rel="alternate" type="text/xml+oembed" href="https://audio.com/oembed?format=xml&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
228+ </head>
229+ <body>
230+ <h1>Ambient Focus Collection</h1>
231+ </body>
232+ </html>
233+ """
234+
199235 When I run `wp embed provider match https://audio.com/audio-com/collections/ambient-focus`
200236 Then save STDOUT as {DEFAULT_STDOUT}
201237
@@ -243,6 +279,24 @@ Feature: Register and use custom oEmbed providers
243279
244280 @require-wp-4.0
245281 Scenario : Only match an oEmbed provider if discover
282+ # Mock the audio.com URL to return HTML with oEmbed discovery links
283+ Given that HTTP requests to https://audio.com/audio-com/collections/ambient-focus will respond with:
284+ """
285+ HTTP/1.1 200
286+ Content-Type: text/html
287+
288+ <!DOCTYPE html>
289+ <html>
290+ <head>
291+ <link rel="alternate" type="application/json+oembed" href="https://audio.com/oembed?format=json&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
292+ <link rel="alternate" type="text/xml+oembed" href="https://audio.com/oembed?format=xml&url=https%3A%2F%2Faudio.com%2Faudio-com%2Fcollections%2Fambient-focus" title="Ambient Focus Collection">
293+ </head>
294+ <body>
295+ <h1>Ambient Focus Collection</h1>
296+ </body>
297+ </html>
298+ """
299+
246300 When I try `wp embed provider match https://audio.com/audio-com/collections/ambient-focus --no-discover`
247301 Then the return code should be 1
248302 And STDERR should be:
0 commit comments