From 898a96ccfb099fa2f87cf56ada210adacaa56641 Mon Sep 17 00:00:00 2001 From: Rajinsharwar Date: Tue, 14 Nov 2023 18:02:11 -0500 Subject: [PATCH] Deleting the unit tests --- tests/phpunit/includes/testcase-canonical.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/includes/testcase-canonical.php b/tests/phpunit/includes/testcase-canonical.php index e26d910620ef4..26916fac6e96b 100644 --- a/tests/phpunit/includes/testcase-canonical.php +++ b/tests/phpunit/includes/testcase-canonical.php @@ -276,12 +276,12 @@ public static function delete_shared_fixtures() { } /** - * Assert that a given URL is the same as the canonical URL generated by WP. + * Assert that a given URL is the same a the canonical URL generated by WP. * * @since 4.1.0 * * @param string $test_url Raw URL that will be run through redirect_canonical(). - * @param string|array $expected Expected string or array with 'url' and 'qv' keys. + * @param string $expected Expected string. * @param int $ticket Optional. Trac ticket number. * @param array $expected_doing_it_wrong Array of class/function names expected to throw _doing_it_wrong() notices. */ @@ -308,12 +308,7 @@ public function assertCanonical( $test_url, $expected, $ticket = 0, $expected_do // Just test the path and query if present. if ( isset( $expected['url'] ) ) { - // Check if the expected URL is a regular expression. - if (substr($expected['url'], 0, 1) === '/' && substr($expected['url'], -1) === '/') { - $this->assertRegExp($expected['url'], $parsed_can_url['path'] . ( ! empty( $parsed_can_url['query'] ) ? '?' . $parsed_can_url['query'] : '' ), $ticket_ref ); - } else { - $this->assertSame( $expected['url'], $parsed_can_url['path'] . ( ! empty( $parsed_can_url['query'] ) ? '?' . $parsed_can_url['query'] : '' ), $ticket_ref ); - } + $this->assertSame( $expected['url'], $parsed_can_url['path'] . ( ! empty( $parsed_can_url['query'] ) ? '?' . $parsed_can_url['query'] : '' ), $ticket_ref ); } // If the test data doesn't include expected query vars, then we're done here.