From 83c271dfa881759366fd62b094242691ccaf5fe7 Mon Sep 17 00:00:00 2001 From: Michael Etokakpan Date: Fri, 11 Sep 2026 16:59:13 +0100 Subject: [PATCH 1/2] Tests: Avoid the `utf8` charset alias in database charset tests. MariaDB 13.1 removes `UTF8_IS_UTF8MB3` from the default `old_mode`, so the `utf8` alias now creates `utf8mb4` instead of `utf8mb3`. Four tests in `Tests_DB_Charset` relied on the alias meaning 3-byte UTF-8. Declare `utf8mb3` explicitly in the affected data sets, and use `utf8mb4` in the `set_charset()` collation test, so the expectations no longer depend on the server. Fixes #66072. --- tests/phpunit/tests/db/charset.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php index 8b3fdb2f10885..6e1eb0aa4141c 100644 --- a/tests/phpunit/tests/db/charset.php +++ b/tests/phpunit/tests/db/charset.php @@ -749,7 +749,7 @@ public function test_strip_invalid_text_for_column() { ), ), array( - 'definition' => '( a VARCHAR(50) CHARACTER SET utf8, b TEXT CHARACTER SET utf8mb4 )', + 'definition' => '( a VARCHAR(50) CHARACTER SET utf8mb3, b TEXT CHARACTER SET utf8mb4 )', 'table_expected' => 'utf8', 'column_expected' => array( 'a' => 'utf8', @@ -786,6 +786,7 @@ public function data_get_table_charset() { /** * @dataProvider data_get_table_charset * @ticket 21212 + * @ticket 66072 * * @covers wpdb::get_table_charset */ @@ -822,6 +823,7 @@ public function data_get_column_charset() { /** * @dataProvider data_get_column_charset * @ticket 21212 + * @ticket 66072 * * @covers wpdb::get_col_charset */ @@ -907,7 +909,7 @@ public function data_strip_invalid_text_from_query() { ), 'utf8 + utf8mb4' => array( // utf8/utf8mb4 tables default to utf8. - 'create' => '( a VARCHAR(50) CHARACTER SET utf8, b VARCHAR(50) CHARACTER SET utf8mb4 )', + 'create' => '( a VARCHAR(50) CHARACTER SET utf8mb3, b VARCHAR(50) CHARACTER SET utf8mb4 )', 'query' => "('foo\xf0\x9f\x98\x88bar', 'foo')", 'expected' => "('foobar', 'foo')", ), @@ -931,6 +933,7 @@ public function data_strip_invalid_text_from_query() { /** * @dataProvider data_strip_invalid_text_from_query * @ticket 21212 + * @ticket 66072 * * @covers wpdb::strip_invalid_text_from_query */ @@ -1155,14 +1158,15 @@ public function test_no_db_charset_defined() { /** * @ticket 36649 + * @ticket 66072 * * @covers wpdb::set_charset */ public function test_set_charset_changes_the_connection_collation() { - self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8', 'utf8_general_ci' ); - $results = self::$_wpdb->get_results( "SHOW VARIABLES WHERE Variable_name='collation_connection'" ); - $expected = self::$utf8_is_utf8mb3 ? 'utf8mb3_general_ci' : 'utf8_general_ci'; - $this->assertSame( $expected, $results[0]->Value, "Collation should be set to $expected." ); + // Avoid the `utf8` alias: it resolves to utf8mb3 or utf8mb4 depending on the server version. + self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8mb4', 'utf8mb4_general_ci' ); + $results = self::$_wpdb->get_results( "SHOW VARIABLES WHERE Variable_name='collation_connection'" ); + $this->assertSame( 'utf8mb4_general_ci', $results[0]->Value, 'Collation should be set to utf8mb4_general_ci.' ); self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8mb4', 'utf8mb4_unicode_ci' ); $results = self::$_wpdb->get_results( "SHOW VARIABLES WHERE Variable_name='collation_connection'" ); From 188413e4f0ed3931f66e2b557d6c00161d6d6dd0 Mon Sep 17 00:00:00 2001 From: Michael Etokakpan Date: Fri, 11 Sep 2026 21:35:43 +0100 Subject: [PATCH 2/2] Build/Test Tools: Document Windows Docker setup --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index eb88e407cb612..22224a569c298 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,14 @@ You will also need a container environment such as [Docker Desktop](https://www. **Note:** WordPress currently only officially supports Docker but several container environments are available and should generally be compatible, such as [Colima](https://github.com/abiosoft/colima), [OrbStack](https://orbstack.dev/), [Podman Desktop](https://podman-desktop.io/), and [Rancher Desktop](https://rancherdesktop.io/). +#### Windows-specific instructions + +For development on Windows, [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/install) is recommended. This provides a Linux environment where the general development instructions can be used without modification. + +After installing Docker Desktop, enable Docker's WSL integration under **Settings > Resources > WSL integration**. This only needs to be configured once. + +If you use Docker Desktop directly from Windows without WSL, make sure it is using Linux containers. Right-click the Docker icon in the system tray and select **Switch to Linux containers...**. If that option is not available, or the menu shows **Switch to Windows containers...**, Docker is already using Linux containers. You can switch between container types later if another project requires Windows containers. + ### Development Environment Commands Ensure your container environment is running before using these commands.