mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
sitemaps.php
43 lines (36 loc) · 1.55 KB
/
sitemaps.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* @group canonical
* @group rewrite
* @group query
* @group sitemaps
*/
class Tests_Canonical_Sitemaps extends WP_Canonical_UnitTestCase {
public function setUp() {
parent::setUp();
$wp_sitemaps = new WP_Sitemaps();
$wp_sitemaps->init();
}
public function test_remove_trailing_slashes_for_sitemap_index_requests() {
$this->set_permalink_structure( '/%postname%/' );
$this->assertCanonical( '/wp-sitemap.xml', '/wp-sitemap.xml' );
$this->assertCanonical( '/wp-sitemap.xml/', '/wp-sitemap.xml' );
}
public function test_remove_trailing_slashes_for_sitemap_index_stylesheet_requests() {
$this->set_permalink_structure( '/%postname%/' );
$this->assertCanonical( '/wp-sitemap-index.xsl', '/wp-sitemap-index.xsl' );
$this->assertCanonical( '/wp-sitemap-index.xsl/', '/wp-sitemap-index.xsl' );
}
public function test_remove_trailing_slashes_for_sitemap_requests() {
$this->set_permalink_structure( '/%postname%/' );
$this->assertCanonical( '/wp-sitemap-posts-post-1.xml', '/wp-sitemap-posts-post-1.xml' );
$this->assertCanonical( '/wp-sitemap-posts-post-1.xml/', '/wp-sitemap-posts-post-1.xml' );
$this->assertCanonical( '/wp-sitemap-users-1.xml', '/wp-sitemap-users-1.xml' );
$this->assertCanonical( '/wp-sitemap-users-1.xml/', '/wp-sitemap-users-1.xml' );
}
public function test_remove_trailing_slashes_for_sitemap_stylesheet_requests() {
$this->set_permalink_structure( '/%postname%/' );
$this->assertCanonical( '/wp-sitemap.xsl', '/wp-sitemap.xsl' );
$this->assertCanonical( '/wp-sitemap.xsl/', '/wp-sitemap.xsl' );
}
}