Skip to content

Commit

Permalink
Deleting the unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajinsharwar committed Nov 14, 2023
1 parent 023b2f2 commit 898a96c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/phpunit/includes/testcase-canonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
Expand Down

0 comments on commit 898a96c

Please sign in to comment.