Make WordPress Core

Changeset 1331 in tests


Ignore:
Timestamp:
07/30/2013 08:58:13 AM (11 years ago)
Author:
ryan
Message:

Update test_get_media_embedded_in_content() to reflect changes in get_media_embedded_in_content().

see #24202

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/media.php

    r1313 r1331  
    279279
    280280    function test_get_media_embedded_in_content() {
    281         $obj =<<<OBJ
     281        $object =<<<OBJ
    282282<object src="this" data="that">
    283283    <param name="value"/>
     
    303303        $content =<<<CONTENT
    304304This is a comment
    305 $obj
     305$object
    306306
    307307This is a comment
     
    320320CONTENT;
    321321
    322         $audios = array_values( compact( 'audio', 'obj', 'embed', 'iframe' ) );
    323         $videos = array_values( compact( 'video', 'obj', 'embed', 'iframe' ) );
    324 
    325         $matches = get_media_embedded_in_content( 'audio', $content );
    326         $this->assertEquals( $matches, $audios );
    327         $matches = get_media_embedded_in_content( 'video', $content );
    328         $this->assertEquals( $matches, $videos );
     322        $types = array( 'audio', 'video', 'object', 'embed', 'iframe' );
     323        $contents = array_values( compact( $types ) );
     324
     325        $matches = get_media_embedded_in_content( $content, 'audio' );
     326        $this->assertEquals( array( $audio ), $matches );
     327
     328        $matches = get_media_embedded_in_content( $content, 'video' );
     329        $this->assertEquals( array( $video ), $matches );
     330
     331        $matches = get_media_embedded_in_content( $content, 'object' );
     332        $this->assertEquals( array( $object ), $matches );
     333
     334        $matches = get_media_embedded_in_content( $content, 'embed' );
     335        $this->assertEquals( array( $embed ), $matches );
     336
     337        $matches = get_media_embedded_in_content( $content, 'iframe' );
     338        $this->assertEquals( array( $iframe ), $matches );
     339
     340        $matches = get_media_embedded_in_content( $content, $types );
     341        $this->assertEquals( $contents, $matches );
    329342    }
    330343}
Note: See TracChangeset for help on using the changeset viewer.