Skip to content

Commit

Permalink
Tests: Correct the wp_theme_json_data_default filter name in assert…
Browse files Browse the repository at this point in the history
…ion messages.

The `theme_json_default` filter was previously renamed to `wp_theme_json_data_default`.

This commit updates the messages in `WP_Theme_JSON_Resolver` tests to match the new name.

Follow-up to [54501], [54630].

See #56796, #56835.

git-svn-id: https://develop.svn.wordpress.org/trunk@54631 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov authored and = committed Nov 4, 2022
1 parent 999f3a3 commit b18ad22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/phpunit/tests/theme/wpThemeJsonResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function test_get_core_data( $should_fire_filter, $core_is_cached, $block
$expected_filter_count++;
}

$this->assertSame( $expected_filter_count, did_filter( 'wp_theme_json_data_default' ), 'The filter "theme_json_default" should fire the given number of times' );
$this->assertSame( $expected_filter_count, did_filter( 'wp_theme_json_data_default' ), 'The filter "wp_theme_json_data_default" should fire the given number of times' );
$this->assertInstanceOf( WP_Theme_JSON::class, $actual, 'WP_Theme_JSON_Resolver::get_core_data() should return instance of WP_Theme_JSON' );
$this->assertSame( static::$property_core->getValue(), $actual, 'WP_Theme_JSON_Resolver::$core property should be the same object as returned from WP_Theme_JSON_Resolver::get_core_data()' );
}
Expand Down Expand Up @@ -705,7 +705,7 @@ function test_get_theme_data_theme_supports_overrides_theme_json() {
$this->assertInstanceOf( 'WP_Theme_JSON', $theme_data, 'Theme data should be an instance of WP_Theme_JSON.' );

// Test that wp_theme_json_data_theme filter has been called.
$this->assertGreaterThan( 0, did_filter( 'wp_theme_json_data_default' ), 'The filter "theme_json_default" should fire.' );
$this->assertGreaterThan( 0, did_filter( 'wp_theme_json_data_default' ), 'The filter "wp_theme_json_data_default" should fire.' );

// Test that data from theme.json is backfilled from existing theme supports.
$previous_settings = $theme_data->get_settings();
Expand Down

0 comments on commit b18ad22

Please sign in to comment.