Changeset 55289 for trunk/tests/phpunit/tests/formatting/wpRelUgc.php
- Timestamp:
- 02/07/2023 06:52:24 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/wpRelUgc.php
r53562 r55289 12 12 */ 13 13 public function test_add_ugc() { 14 if ( PHP_VERSION_ID >= 80100 ) {15 /*16 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in17 * via hooked in filter functions until a more structural solution to the18 * "missing input validation" conundrum has been architected and implemented.19 */20 $this->expectDeprecation();21 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );22 }23 24 14 $content = '<p>This is some cool <a href="/">Code</a></p>'; 25 15 $expected = '<p>This is some cool <a href=\"/\" rel=\"nofollow ugc\">Code</a></p>'; … … 31 21 */ 32 22 public function test_convert_ugc() { 33 if ( PHP_VERSION_ID >= 80100 ) {34 /*35 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in36 * via hooked in filter functions until a more structural solution to the37 * "missing input validation" conundrum has been architected and implemented.38 */39 $this->expectDeprecation();40 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );41 }42 43 23 $content = '<p>This is some cool <a href="/" rel="weird">Code</a></p>'; 44 24 $expected = '<p>This is some cool <a href=\"/\" rel=\"weird nofollow ugc\">Code</a></p>'; … … 51 31 */ 52 32 public function test_wp_rel_ugc( $input, $output, $expect_deprecation = false ) { 53 if ( true === $expect_deprecation && PHP_VERSION_ID >= 80100 ) {54 /*55 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in56 * via hooked in filter functions until a more structural solution to the57 * "missing input validation" conundrum has been architected and implemented.58 */59 $this->expectDeprecation();60 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );61 }62 63 33 $this->assertSame( wp_slash( $output ), wp_rel_ugc( $input ) ); 64 34 } … … 100 70 array( 101 71 '<a href="' . $home_url_http . '/some-url">Home URL (http)</a>', 102 '<a href="' . $home_url_http . '/some-url" >Home URL (http)</a>',72 '<a href="' . $home_url_http . '/some-url" rel="ugc">Home URL (http)</a>', 103 73 ), 104 74 array( 105 75 '<a href="' . $home_url_https . '/some-url">Home URL (https)</a>', 106 '<a href="' . $home_url_https . '/some-url" >Home URL (https)</a>',76 '<a href="' . $home_url_https . '/some-url" rel="ugc">Home URL (https)</a>', 107 77 ), 108 78 ); … … 110 80 111 81 public function test_append_ugc_with_valueless_attribute() { 112 if ( PHP_VERSION_ID >= 80100 ) {113 /*114 * For the time being, ignoring PHP 8.1 "null to non-nullable" deprecations coming in115 * via hooked in filter functions until a more structural solution to the116 * "missing input validation" conundrum has been architected and implemented.117 */118 $this->expectDeprecation();119 $this->expectDeprecationMessageMatches( '`Passing null to parameter \#[0-9]+ \(\$[^\)]+\) of type [^ ]+ is deprecated`' );120 }121 82 122 83 $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>';
Note: See TracChangeset
for help on using the changeset viewer.