@@ -3,7 +3,7 @@ Feature: Manage oEmbed cache.
3
3
Background :
4
4
Given a WP install
5
5
6
- # Behavior that's the same for all WP versions.
6
+ @require-wp-4.0
7
7
Scenario : Get HTML embed code for a given URL
8
8
# Known provider not requiring discovery.
9
9
When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --width=500`
@@ -98,7 +98,7 @@ Feature: Manage oEmbed cache.
98
98
And STDOUT should be empty
99
99
100
100
# No sanitization prior to WP 4.4.
101
- @less-than-wp-4.4
101
+ @less-than-wp-4.4 @require-wp-4.0
102
102
Scenario : Get HTML embed code for a given URL that requires discovery and is sanitized
103
103
# Old versions of WP_oEmbed can trigger PHP "Only variables should be passed by reference" notices on discover so use "try" to cater for these.
104
104
When I try `wp embed fetch https://asciinema.org/a/140798`
@@ -112,6 +112,7 @@ Feature: Manage oEmbed cache.
112
112
asciinema.org/
113
113
"""
114
114
115
+ @require-wp-4.0
115
116
Scenario : Get raw oEmbed data for a given URL
116
117
When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --raw`
117
118
And save STDOUT as {DEFAULT_STDOUT}
@@ -140,6 +141,7 @@ Feature: Manage oEmbed cache.
140
141
asciinema.org
141
142
"""
142
143
144
+ @require-wp-4.0
143
145
Scenario : Fail then succeed when given unknown discoverable provider for a raw request, depending on discover option
144
146
When I try `wp embed fetch http://LearningApps.org/259 --raw --no-discover`
145
147
# Old versions of WP_oEmbed can trigger PHP "Only variables should be passed by reference" notices on discovery so use "contain" to ignore these.
@@ -160,6 +162,7 @@ Feature: Manage oEmbed cache.
160
162
LearningApps.org
161
163
"""
162
164
165
+ @require-wp-4.0
163
166
Scenario : Bails when no oEmbed provider is found for a raw request
164
167
When I try `wp embed fetch https://foo.example.com --raw`
165
168
# Old versions of WP_oEmbed can trigger PHP "Only variables should be passed by reference" notices on discovery so use "contain" to ignore these.
@@ -168,6 +171,7 @@ Feature: Manage oEmbed cache.
168
171
Error: No oEmbed provider found for given URL.
169
172
"""
170
173
174
+ @require-wp-4.0
171
175
Scenario : Bails when no oEmbed provider is found for a raw request and discovery is off
172
176
When I try `wp embed fetch https://foo.example.com --raw --discover=0`
173
177
Then STDERR should be:
@@ -185,7 +189,7 @@ Feature: Manage oEmbed cache.
185
189
"""
186
190
187
191
# WP prior to 4.9 does not return clickable link.
188
- @less-than-wp-4.9
192
+ @less-than-wp-4.9 @require-wp-4.0
189
193
Scenario : Doesn't make unknown URLs clickable
190
194
When I try `wp embed fetch https://foo.example.com`
191
195
Then the return code should be 1
@@ -196,6 +200,7 @@ Feature: Manage oEmbed cache.
196
200
"""
197
201
And STDOUT should be empty
198
202
203
+ @require-wp-4.0
199
204
Scenario : Caches oEmbed response data for a given post
200
205
# Note need post author for 'unfiltered_html' check to work for WP < 4.4.
201
206
When I run `wp post create --post_title="Foo Bar" --post_author=1 --porcelain`
@@ -220,6 +225,7 @@ Feature: Manage oEmbed cache.
220
225
Success: Cleared oEmbed cache.
221
226
"""
222
227
228
+ @require-wp-4.0
223
229
Scenario : Return data as XML when requested
224
230
When I run `wp embed fetch https://www.youtube.com/watch?v=dQw4w9WgXcQ --raw-format=xml --raw`
225
231
Then STDOUT should contain:
@@ -348,6 +354,7 @@ Feature: Manage oEmbed cache.
348
354
<iframe
349
355
"""
350
356
357
+ @require-wp-4.0
351
358
Scenario : Invoke built-in audio handler
352
359
When I run `wp post create --post_title="Foo Bar" --porcelain`
353
360
Then STDOUT should be a number
@@ -373,6 +380,7 @@ Feature: Manage oEmbed cache.
373
380
<audio
374
381
"""
375
382
383
+ @require-wp-4.0
376
384
Scenario : Invoke built-in video handler
377
385
When I run `wp post create --post_title="Foo Bar" --porcelain`
378
386
Then STDOUT should be a number
@@ -399,7 +407,7 @@ Feature: Manage oEmbed cache.
399
407
"""
400
408
401
409
# `wp_embed_handler_googlevideo` handler deprecated WP 4.6.
402
- @less-than-wp-4.6
410
+ @less-than-wp-4.6 @require-wp-4.0
403
411
Scenario : Invoke built-in Google Video handler
404
412
When I run `wp post create --post_title="Foo Bar" --porcelain`
405
413
Then STDOUT should be a number
@@ -415,6 +423,7 @@ Feature: Manage oEmbed cache.
415
423
<embed
416
424
"""
417
425
426
+ @require-wp-4.0
418
427
Scenario : Incompatible options
419
428
When I try `wp embed fetch https://www.example.com/watch?v=dQw4w9WgXcQ --no-discover --limit-response-size=50000`
420
429
Then the return code should be 1
0 commit comments