mirror of
git://develop.git.wordpress.org/
synced 2025-02-07 08:04:27 +01:00
Tests: Use assertSame()
in some WP_Theme_JSON
tests.
This ensures that not only the return values match the expected results, but also that their type is the same. Previously committed in [54402], these instances appear to be accidentally reverted to `assertEquals()` in [54443]. Follow-up to [52275], [54162], [54402], [54443]. See #55654. git-svn-id: https://develop.svn.wordpress.org/trunk@54446 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6d9701a6f0
commit
bd001e80df
@ -3411,7 +3411,7 @@ class Tests_Theme_wpThemeJson extends WP_UnitTestCase {
|
||||
'default'
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
$this->assertSame(
|
||||
'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1rem; }body { --wp--style--block-gap: 1rem; }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: 1rem;margin-block-end: 0;}body .is-layout-flex{gap: 1rem;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}.wp-block-post-content{color: gray;}.wp-block-social-links.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flex{gap: 0;}.wp-block-buttons.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flex{gap: 0;}',
|
||||
$theme_json->get_stylesheet()
|
||||
);
|
||||
|
@ -388,7 +388,7 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
|
||||
WP_Theme_JSON_Resolver::clean_cached_data();
|
||||
}
|
||||
$query_count = count( $this->queries ) - $query_count;
|
||||
$this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
|
||||
$this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
|
||||
|
||||
$user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
|
||||
$this->assertEmpty( $user_cpt );
|
||||
@ -403,7 +403,7 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase {
|
||||
$this->assertSameSets( $user_cpt, $new_user_cpt );
|
||||
}
|
||||
$query_count = count( $this->queries ) - $query_count;
|
||||
$this->assertEquals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
|
||||
$this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );
|
||||
remove_filter( 'query', array( $this, 'filter_db_query' ) );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user