wordpress-develop/tests/phpunit/tests/sitemaps/wpSitemapsStylesheet.php
Sergey Biryukov 7f828b6b00 Tests: Rename classes in phpunit/tests/sitemaps/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51492 602fd350-edb4-49c9-b593-d223f7449a82
2021-07-26 19:09:41 +00:00

44 lines
1.2 KiB
PHP

<?php
/**
* @group sitemaps
*/
class Tests_Sitemaps_wpSitemapsStylesheet extends WP_UnitTestCase {
/**
* Test that stylesheet content can be filtered.
*/
public function test_filter_sitemaps_stylesheet_content() {
$stylesheet = new WP_Sitemaps_Stylesheet();
add_filter( 'wp_sitemaps_stylesheet_content', '__return_empty_string' );
$content = $stylesheet->get_sitemap_stylesheet();
$this->assertSame( '', $content, 'Could not filter stylesheet content' );
}
/**
* Test that sitemap index stylesheet content can be filtered.
*/
public function test_filter_sitemaps_stylesheet_index_content() {
$stylesheet = new WP_Sitemaps_Stylesheet();
add_filter( 'wp_sitemaps_stylesheet_index_content', '__return_empty_string' );
$content = $stylesheet->get_sitemap_index_stylesheet();
$this->assertSame( '', $content, 'Could not filter sitemap index stylesheet content' );
}
/**
* Test that sitemap stylesheet CSS can be filtered.
*/
public function test_filter_sitemaps_stylesheet_css() {
$stylesheet = new WP_Sitemaps_Stylesheet();
add_filter( 'wp_sitemaps_stylesheet_css', '__return_empty_string' );
$css = $stylesheet->get_stylesheet_css();
$this->assertSame( '', $css, 'Could not filter sitemap stylesheet CSS' );
}
}