WordPress.org

Make WordPress Core

Changeset 35178


Ignore:
Timestamp:
10/15/2015 01:28:05 AM (6 years ago)
Author:
wonderboymusic
Message:

Unit Tests: move some oEmbed tests that can trigger HTTP calls to Tests_External_HTTP_OEmbed.

See #30017, #33968.

Location:
trunk/tests/phpunit/tests
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r34855 r35178  
    113113        $this->assertTrue( wp_oembed_remove_provider( 'http://foo.bar/*' ) );
    114114        $this->assertFalse( wp_oembed_remove_provider( 'http://foo.bar/*' ) );
    115     }
    116 
    117     /**
    118      * Test secure youtube.com embeds
    119      *
    120      * @ticket 23149
    121      */
    122     function test_youtube_com_secure_embed() {
    123         $out = wp_oembed_get( 'http://www.youtube.com/watch?v=oHg5SJYRHA0' );
    124         $this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
    125 
    126         $out = wp_oembed_get( 'https://www.youtube.com/watch?v=oHg5SJYRHA0' );
    127         $this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
    128 
    129         $out = wp_oembed_get( 'https://youtu.be/zHjMoNQN7s0' );
    130         $this->assertContains( 'https://www.youtube.com/embed/zHjMoNQN7s0?feature=oembed', $out );
    131     }
    132 
    133     /**
    134      * Test m.youtube.com embeds
    135      *
    136      * @ticket 32714
    137      */
    138     function test_youtube_com_mobile_embed() {
    139         $out = wp_oembed_get( 'http://m.youtube.com/watch?v=oHg5SJYRHA0' );
    140         $this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
    141 
    142         $out = wp_oembed_get( 'https://m.youtube.com/watch?v=oHg5SJYRHA0' );
    143         $this->assertContains( 'https://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed', $out );
    144     }
    145 
    146     function test_youtube_embed_url() {
    147         global $wp_embed;
    148         $out = $wp_embed->autoembed( 'https://www.youtube.com/embed/QcIy9NiNbmo' );
    149         $this->assertContains( 'https://youtube.com/watch?v=QcIy9NiNbmo', $out );
    150     }
    151 
    152     function test_youtube_v_url() {
    153         global $wp_embed;
    154         $out = $wp_embed->autoembed( 'https://www.youtube.com/v/QcIy9NiNbmo' );
    155         $this->assertContains( 'https://youtube.com/watch?v=QcIy9NiNbmo', $out );
    156115    }
    157116
Note: See TracChangeset for help on using the changeset viewer.