Changeset 55562 for trunk/tests/phpunit/tests/formatting/linksAddTarget.php
- Timestamp:
- 03/19/2023 12:03:30 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/linksAddTarget.php
r53562 r55562 6 6 */ 7 7 class Tests_Formatting_LinksAddTarget extends WP_UnitTestCase { 8 9 /** 10 * Validate the normalize_whitespace function 11 * 12 * @dataProvider data_links_add_target 13 */ 14 public function test_links_add_target( $content, $target, $tags, $exp_str ) { 15 if ( true === is_null( $target ) ) { 16 $this->assertSame( $exp_str, links_add_target( $content ) ); 17 } elseif ( true === is_null( $tags ) ) { 18 $this->assertSame( $exp_str, links_add_target( $content, $target ) ); 19 } else { 20 $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) ); 21 } 22 } 23 8 24 /** 9 25 * Test Content DataProvider … … 11 27 * array ( input_txt, converted_output_txt) 12 28 */ 13 public function get_input_output() {29 public function data_links_add_target() { 14 30 return array( 15 31 array( … … 93 109 ); 94 110 } 95 96 /**97 * Validate the normalize_whitespace function98 *99 * @dataProvider get_input_output100 */101 public function test_normalize_whitespace( $content, $target, $tags, $exp_str ) {102 if ( true === is_null( $target ) ) {103 $this->assertSame( $exp_str, links_add_target( $content ) );104 } elseif ( true === is_null( $tags ) ) {105 $this->assertSame( $exp_str, links_add_target( $content, $target ) );106 } else {107 $this->assertSame( $exp_str, links_add_target( $content, $target, $tags ) );108 }109 }110 111 }
Note: See TracChangeset
for help on using the changeset viewer.