- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/GetUrlInContent.php
r33905 r42343 5 5 */ 6 6 class Tests_Formatting_GetUrlInContent extends WP_UnitTestCase { 7 7 8 8 /** 9 9 * URL Content Data Provider … … 12 12 */ 13 13 public function get_input_output() { 14 return array (15 array (16 "",17 false 14 return array( 15 array( 16 '', 17 false, 18 18 ), //empty content 19 array (20 "<div>NO URL CONTENT</div>",21 false 19 array( 20 '<div>NO URL CONTENT</div>', 21 false, 22 22 ), //no URLs 23 array (23 array( 24 24 '<div href="/relative.php">NO URL CONTENT</div>', 25 false 25 false, 26 26 ), // ignore none link elements 27 array (27 array( 28 28 'ABC<div><a href="/relative.php">LINK</a> CONTENT</div>', 29 "/relative.php"29 '/relative.php', 30 30 ), // single link 31 array (31 array( 32 32 'ABC<div><a href="/relative.php">LINK</a> CONTENT <a href="/suppress.php">LINK</a></div>', 33 "/relative.php"33 '/relative.php', 34 34 ), // multiple links 35 array (35 array( 36 36 'ABC<div><a href="http://example.com/Mr%20WordPress 2">LINK</a> CONTENT </div>', 37 "http://example.com/Mr%20WordPress%202"37 'http://example.com/Mr%20WordPress%202', 38 38 ), // escape link 39 39 ); … … 42 42 /** 43 43 * Validate the get_url_in_content function 44 * 44 45 * @dataProvider get_input_output 45 46 */ 46 47 function test_get_url_in_content( $in_str, $exp_str ) { 47 $this->assertEquals( $exp_str, get_url_in_content( $in_str ) );48 $this->assertEquals( $exp_str, get_url_in_content( $in_str ) ); 48 49 } 49 50 }
Note: See TracChangeset
for help on using the changeset viewer.