@@ -3,7 +3,6 @@ Feature: Manage oEmbed fetch.
33 Background :
44 Given a WP install
55
6- @require-wp-4.0
76 Scenario : Get HTML embed code for a given URL
87 # Known provider not requiring discovery.
98 When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500`
@@ -77,8 +76,6 @@ Feature: Manage oEmbed fetch.
7776 <script
7877 """
7978
80- # WP 4.9 always returns clickable link even for sanitized oEmbed responses.
81- @require-wp-4.9
8279 Scenario : Get HTML embed code for a given URL that requires discovery and is sanitized
8380 When I run `wp embed fetch https://app.ex.co/stories/item/8fb2343f-fa5d-48d4-8723-f8b5d51cc1a9`
8481 Then STDOUT should contain:
@@ -90,7 +87,6 @@ Feature: Manage oEmbed fetch.
9087 <a
9188 """
9289
93- @require-wp-4.0
9490 Scenario : Get raw oEmbed data for a given URL
9591 When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --raw`
9692 And save STDOUT as {DEFAULT_STDOUT}
@@ -119,7 +115,6 @@ Feature: Manage oEmbed fetch.
119115 ceros.com
120116 """
121117
122- @require-wp-4.0
123118 Scenario : Fail then succeed when given unknown discoverable provider for a raw request, depending on discover option
124119 When I try `wp embed fetch http://LearningApps.org/259 --raw --no-discover`
125120 # Old versions of WP_oEmbed can trigger PHP "Only variables should be passed by reference" notices on discovery so use "contain" to ignore these.
@@ -140,7 +135,6 @@ Feature: Manage oEmbed fetch.
140135 LearningApps.org
141136 """
142137
143- @require-wp-4.0
144138 Scenario : Bails when no oEmbed provider is found for a raw request
145139 When I try `wp embed fetch https://foo.example.com --raw`
146140 # Old versions of WP_oEmbed can trigger PHP "Only variables should be passed by reference" notices on discovery so use "contain" to ignore these.
@@ -149,24 +143,20 @@ Feature: Manage oEmbed fetch.
149143 Error: No oEmbed provider found for given URL.
150144 """
151145
152- @require-wp-4.0
153146 Scenario : Bails when no oEmbed provider is found for a raw request and discovery is off
154147 When I try `wp embed fetch https://foo.example.com --raw --discover=0`
155148 Then STDERR should be:
156149 """
157150 Error: No oEmbed provider found for given URL. Maybe try discovery?
158151 """
159152
160- # WP 4.9 always returns clickable link.
161- @require-wp-4.9
162153 Scenario : Makes unknown URLs clickable
163154 When I run `wp embed fetch https://foo.example.com`
164155 Then STDOUT should contain:
165156 """
166157 <a href="https://foo.example.com">https://foo.example.com</a>
167158 """
168159
169- @require-wp-4.0
170160 Scenario : Caches oEmbed response data for a given post
171161 # Note need post author for 'unfiltered_html' check to work for WP < 4.4.
172162 When I run `wp post create --post_title="Foo Bar" --post_author=1 --porcelain`
@@ -191,7 +181,6 @@ Feature: Manage oEmbed fetch.
191181 Success: Cleared oEmbed cache.
192182 """
193183
194- @require-wp-4.0
195184 Scenario : Return data as XML when requested
196185 When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --raw-format=xml --raw`
197186 Then STDOUT should contain:
@@ -200,7 +189,6 @@ Feature: Manage oEmbed fetch.
200189 """
201190
202191 # Depends on `oembed_remote_get_args` filter introduced WP 4.0 https://core.trac.wordpress.org/ticket/23442
203- @require-wp-4.0
204192 Scenario : Get embed code for a URL with limited response size
205193 # Need post_id for caching to work for WP < 4.9, and also post_author for caching to work for WP < 4.4 (due to 'unfiltered_html' check).
206194 When I run `wp post create --post_title="Foo Bar" --post_author=1 --porcelain`
@@ -246,8 +234,6 @@ Feature: Manage oEmbed fetch.
246234 {DEFAULT_STDOUT}
247235 """
248236
249- # Same as above but without the post_id. WP >= 4.9 only
250- @require-wp-4.9
251237 Scenario : Get embed code for a URL with limited response size and post-less cache
252238 When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ`
253239 And save STDOUT as {DEFAULT_STDOUT}
@@ -288,8 +274,6 @@ Feature: Manage oEmbed fetch.
288274 {DEFAULT_STDOUT}
289275 """
290276
291- # Depends on `wp_filter_pre_oembed_result` filter introduced WP 4.5.3 https://core.trac.wordpress.org/ticket/36767
292- @require-wp-4.5.3
293277 Scenario : Fetch locally provided URL
294278 When I run `wp embed fetch http://example.com/?p=1`
295279 Then STDOUT should contain:
@@ -304,7 +288,6 @@ Feature: Manage oEmbed fetch.
304288 """
305289
306290 # `wp_embed_handler_youtube` handler introduced WP 4.0.
307- @require-wp-4.0
308291 Scenario : Invoke built-in YouTube handler
309292 When I run `wp post create --post_title="Foo Bar" --porcelain`
310293 Then STDOUT should be a number
@@ -320,7 +303,6 @@ Feature: Manage oEmbed fetch.
320303 <iframe
321304 """
322305
323- @require-wp-4.0
324306 Scenario : Invoke built-in audio handler
325307 When I run `wp post create --post_title="Foo Bar" --porcelain`
326308 Then STDOUT should be a number
@@ -346,7 +328,6 @@ Feature: Manage oEmbed fetch.
346328 <audio
347329 """
348330
349- @require-wp-4.0
350331 Scenario : Invoke built-in video handler
351332 When I run `wp post create --post_title="Foo Bar" --porcelain`
352333 Then STDOUT should be a number
@@ -372,7 +353,6 @@ Feature: Manage oEmbed fetch.
372353 <video
373354 """
374355
375- @require-wp-4.0
376356 Scenario : Incompatible options
377357 When I try `wp embed fetch https://www.example.com/watch?v=dQw4w9WgXcQ --no-discover --limit-response-size=50000`
378358 Then the return code should be 1
0 commit comments