Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions features/fetch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ Feature: Manage oEmbed cache.

# Unknown provider requiring discovery but not returning iframe so would be sanitized for WP >= 4.4 without 'skip-sanitization' option.
# 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.
When I try `wp embed fetch https://view.ceros.com/ceros/new-experience-3/p/1 --skip-sanitization`
When I try `wp embed fetch https://app.ex.co/stories/item/8fb2343f-fa5d-48d4-8723-f8b5d51cc1a9 --skip-sanitization`
Then the return code should be 0
And STDERR should not contain:
"""
Error:
"""
And STDOUT should contain:
"""
ceros.com/
app.ex.co/
"""
And STDOUT should contain:
"""
Expand All @@ -72,14 +72,18 @@ Feature: Manage oEmbed cache.
"""
<iframe
"""
And STDOUT should not contain:
"""
<script
"""

# WP 4.9 always returns clickable link even for sanitized oEmbed responses.
@require-wp-4.9
Scenario: Get HTML embed code for a given URL that requires discovery and is sanitized
When I run `wp embed fetch https://view.ceros.com/ceros/new-experience-3/p/1`
When I run `wp embed fetch https://app.ex.co/stories/item/8fb2343f-fa5d-48d4-8723-f8b5d51cc1a9`
Then STDOUT should contain:
"""
ceros.com/
app.ex.co/
"""
And STDOUT should contain:
"""
Expand Down