Changeset 1331 in tests
- Timestamp:
- 07/30/2013 08:58:13 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/media.php
r1313 r1331 279 279 280 280 function test_get_media_embedded_in_content() { 281 $obj =<<<OBJ281 $object =<<<OBJ 282 282 <object src="this" data="that"> 283 283 <param name="value"/> … … 303 303 $content =<<<CONTENT 304 304 This is a comment 305 $obj 305 $object 306 306 307 307 This is a comment … … 320 320 CONTENT; 321 321 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 ); 329 342 } 330 343 }
Note: See TracChangeset
for help on using the changeset viewer.