mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 02:34:38 +00:00
Canonical: Move trailing slash handling for robots.txt and sitemaps to a single condition.
Give the unit test a more descriptive name. Follow-up to [48153], [48155]. See #48025. git-svn-id: https://develop.svn.wordpress.org/trunk@48166 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -7,12 +7,8 @@
|
||||
*/
|
||||
class Tests_Canonical_Robots extends WP_Canonical_UnitTestCase {
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
function test_robots_url() {
|
||||
$this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
|
||||
public function test_remove_trailing_slashes_for_robots_requests() {
|
||||
$this->set_permalink_structure( '/%postname%/' );
|
||||
$this->assertCanonical( '/robots.txt', '/robots.txt' );
|
||||
$this->assertCanonical( '/robots.txt/', '/robots.txt' );
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* @group sitemaps
|
||||
*/
|
||||
class Tests_Canonical_Sitemaps extends WP_Canonical_UnitTestCase {
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$wp_sitemaps = new WP_Sitemaps();
|
||||
@@ -38,4 +39,5 @@ class Tests_Canonical_Sitemaps extends WP_Canonical_UnitTestCase {
|
||||
$this->assertCanonical( '/wp-sitemap.xsl', '/wp-sitemap.xsl' );
|
||||
$this->assertCanonical( '/wp-sitemap.xsl/', '/wp-sitemap.xsl' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user