Changeset 55289 for trunk/tests/phpunit/tests/formatting/wpRelNofollow.php
- Timestamp:
- 02/07/2023 06:52:24 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/wpRelNofollow.php
r53562 r55289 12 12 */ 13 13 public function test_add_no_follow() { 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\">Code</a></p>'; … … 31 21 */ 32 22 public function test_convert_no_follow() { 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\">Code</a></p>'; … … 51 31 */ 52 32 public function test_wp_rel_nofollow( $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_nofollow( $input ) ); 64 34 } … … 110 80 111 81 public function test_append_no_follow_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 122 82 $content = '<p>This is some cool <a href="demo.com" download rel="hola">Code</a></p>'; 123 83 $expected = '<p>This is some cool <a href=\"demo.com\" download rel=\"hola nofollow\">Code</a></p>';
Note: See TracChangeset
for help on using the changeset viewer.