diff --git a/tests/phpunit/data/languages/themes/block-theme-pl_PL.mo b/tests/phpunit/data/languages/themes/block-theme-pl_PL.mo index ff89f87f12..d819be9b57 100644 Binary files a/tests/phpunit/data/languages/themes/block-theme-pl_PL.mo and b/tests/phpunit/data/languages/themes/block-theme-pl_PL.mo differ diff --git a/tests/phpunit/data/languages/themes/block-theme-pl_PL.po b/tests/phpunit/data/languages/themes/block-theme-pl_PL.po index 0aa4bbd52d..6ac5a6967e 100644 --- a/tests/phpunit/data/languages/themes/block-theme-pl_PL.po +++ b/tests/phpunit/data/languages/themes/block-theme-pl_PL.po @@ -2,22 +2,30 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: 2015-12-31 16:31+0100\n" -"PO-Revision-Date: 2021-03-15 13:10+0100\n" +"PO-Revision-Date: 2022-08-31 11:08+0200\n" +"Last-Translator: \n" +"Language-Team: \n" "Language: pl_PL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.4.2\n" -"X-Poedit-Basepath: .\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.1.1\n" +"X-Poedit-Basepath: .\n" "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;" "_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;" "esc_html_x:1,2c\n" "X-Textdomain-Support: yes\n" -"Last-Translator: \n" -"Language-Team: \n" "X-Poedit-SearchPath-0: .\n" +msgctxt "Style variation name" +msgid "Block theme" +msgstr "Motyw blokowy" + +msgctxt "Style variation name" +msgid "Block theme variation" +msgstr "Wariant motywu blokowego" + msgctxt "Custom template name" msgid "Homepage template" msgstr "Szablon strony głównej" diff --git a/tests/phpunit/data/themedir1/block-theme/styles/variation.json b/tests/phpunit/data/themedir1/block-theme/styles/variation.json index ad3affb115..d0f316cb45 100644 --- a/tests/phpunit/data/themedir1/block-theme/styles/variation.json +++ b/tests/phpunit/data/themedir1/block-theme/styles/variation.json @@ -1,23 +1,24 @@ { - "version": 2, - "settings": { - "color": { - "palette": [ - { - "slug": "foreground", - "color": "#3F67C6", - "name": "Foreground" - } - ] - } - }, - "styles": { - "blocks": { - "core/post-title": { - "typography": { - "fontWeight": "700" - } - } - } - } -} \ No newline at end of file + "version": 2, + "title": "Block theme variation", + "settings": { + "color": { + "palette": [ + { + "slug": "foreground", + "color": "#3F67C6", + "name": "Foreground" + } + ] + } + }, + "styles": { + "blocks": { + "core/post-title": { + "typography": { + "fontWeight": "700" + } + } + } + } +} diff --git a/tests/phpunit/data/themedir1/block-theme/theme.json b/tests/phpunit/data/themedir1/block-theme/theme.json index 38fcb1d9dd..7676d642b2 100644 --- a/tests/phpunit/data/themedir1/block-theme/theme.json +++ b/tests/phpunit/data/themedir1/block-theme/theme.json @@ -1,5 +1,6 @@ { "version": 1, + "title": "Block theme", "settings": { "color": { "palette": [ @@ -36,9 +37,7 @@ "customLineHeight": true }, "spacing": { - "units": [ - "rem" - ], + "units": ["rem"], "customPadding": true }, "blocks": { diff --git a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php index e8756cf85d..2da5e18ab0 100644 --- a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php +++ b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php @@ -471,6 +471,7 @@ class WP_REST_Global_Styles_Controller_Test extends WP_Test_REST_Controller_Test $expected = array( array( 'version' => 2, + 'title' => 'Block theme variation', 'settings' => array( 'color' => array( 'palette' => array( @@ -493,7 +494,6 @@ class WP_REST_Global_Styles_Controller_Test extends WP_Test_REST_Controller_Test ), ), ), - 'title' => 'variation', ), ); $this->assertSameSetsWithIndex( $data, $expected ); diff --git a/tests/phpunit/tests/theme/wpThemeJsonResolver.php b/tests/phpunit/tests/theme/wpThemeJsonResolver.php index 287e5d8aeb..6ec69477b3 100644 --- a/tests/phpunit/tests/theme/wpThemeJsonResolver.php +++ b/tests/phpunit/tests/theme/wpThemeJsonResolver.php @@ -82,13 +82,15 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { load_textdomain( 'block-theme', realpath( DIR_TESTDATA . '/languages/themes/block-theme-pl_PL.mo' ) ); switch_theme( 'block-theme' ); - $actual = WP_Theme_JSON_Resolver::get_theme_data(); + $theme_data = WP_Theme_JSON_Resolver::get_theme_data(); + $style_variations = WP_Theme_JSON_Resolver::get_style_variations(); unload_textdomain( 'block-theme' ); remove_filter( 'locale', array( $this, 'filter_set_locale_to_polish' ) ); - $this->assertSame( wp_get_theme()->get( 'TextDomain' ), 'block-theme' ); - $this->assertSame( + $this->assertSame( 'block-theme', wp_get_theme()->get( 'TextDomain' ) ); + $this->assertSame( 'Motyw blokowy', $theme_data->get_data()['title'] ); + $this->assertSameSets( array( 'color' => array( 'custom' => false, @@ -150,25 +152,29 @@ class Tests_Theme_wpThemeJsonResolver extends WP_UnitTestCase { ), ), ), - $actual->get_settings() + $theme_data->get_settings() ); - $this->assertSame( - $actual->get_custom_templates(), + $this->assertSameSets( array( 'page-home' => array( 'title' => 'Szablon strony głównej', 'postTypes' => array( 'page' ), ), - ) + ), + $theme_data->get_custom_templates() ); - $this->assertSame( - $actual->get_template_parts(), + $this->assertSameSets( array( 'small-header' => array( 'title' => 'Mały nagłówek', 'area' => 'header', ), - ) + ), + $theme_data->get_template_parts() + ); + $this->assertSame( + 'Wariant motywu blokowego', + $style_variations[0]['title'] ); }