Make WordPress Core


Ignore:
Timestamp:
07/21/2020 03:27:48 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Sitemaps: Rename 'sitemap' to 'provider' in WP_Sitemaps_Registry class.

This class is for registering sitemap providers, not individual sitemaps.

Props swissspidy.
Fixes #50724.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/sitemaps/sitemaps-registry.php

    r48072 r48536  
    55 */
    66class Test_WP_Sitemaps_Registry extends WP_UnitTestCase {
    7     public function test_add_sitemap() {
     7    public function test_add_provider() {
    88        $provider = new WP_Sitemaps_Test_Provider();
    99        $registry = new WP_Sitemaps_Registry();
    1010
    11         $actual   = $registry->add_sitemap( 'foo', $provider );
    12         $sitemaps = $registry->get_sitemaps();
     11        $actual   = $registry->add_provider( 'foo', $provider );
     12        $sitemaps = $registry->get_providers();
    1313
    1414        $this->assertTrue( $actual );
     
    1717    }
    1818
    19     public function test_add_sitemap_prevent_duplicates() {
     19    public function test_add_provider_prevent_duplicates() {
    2020        $provider1 = new WP_Sitemaps_Test_Provider();
    2121        $provider2 = new WP_Sitemaps_Test_Provider();
    2222        $registry  = new WP_Sitemaps_Registry();
    2323
    24         $actual1  = $registry->add_sitemap( 'foo', $provider1 );
    25         $actual2  = $registry->add_sitemap( 'foo', $provider2 );
    26         $sitemaps = $registry->get_sitemaps();
     24        $actual1  = $registry->add_provider( 'foo', $provider1 );
     25        $actual2  = $registry->add_provider( 'foo', $provider2 );
     26        $sitemaps = $registry->get_providers();
    2727
    2828        $this->assertTrue( $actual1 );
Note: See TracChangeset for help on using the changeset viewer.