Skip to content

Commit

Permalink
Fix tests (#72)
Browse files Browse the repository at this point in the history
Looks like one of the providers used in #71 changed their oEmbed output since then.
  • Loading branch information
swissspidy authored Jul 17, 2023
1 parent 8a482bd commit fa96740
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit fa96740

Please sign in to comment.