Build/Test Tools: Remove the assertion in filter_rest_url_for_leading_slash().

This assertion can mask the fact that some other tests don't perform an assertion.

Fixes #54661


git-svn-id: https://develop.svn.wordpress.org/trunk@52390 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2021-12-19 14:27:22 +00:00
parent 029bea45b0
commit 7c0f7cbbda

View File

@ -45,7 +45,14 @@ abstract class WP_Test_REST_Controller_Testcase extends WP_Test_REST_TestCase {
} }
// Make sure path for rest_url has a leading slash for proper resolution. // Make sure path for rest_url has a leading slash for proper resolution.
$this->assertTrue( 0 === strpos( $path, '/' ), 'REST API URL should have a leading slash.' ); if ( 0 !== strpos( $path, '/' ) ) {
$this->fail(
sprintf(
'REST API URL "%s" should have a leading slash.',
$path
)
);
}
return $url; return $url;
} }