Skip to content

Commit 20222b7

Browse files
authored
Merge pull request #787 from lucatume/fix-issue-786
Support empty db password
2 parents 9c8bb63 + 5be2031 commit 20222b7

File tree

18 files changed

+224
-18
lines changed

18 files changed

+224
-18
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55

66
## [unreleased] Unreleased
77

8+
### Fixed
9+
10+
- Fixed `DB_PASSWORD` constant not being defined when `dbPassword` configuration parameter is set to an empty string in `WPLoader` module, fixes #786.
11+
812
## [4.5.7] 2025-09-09;
913

1014
### Fixed
@@ -408,7 +412,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
408412
- Set `path` correctly in `WPWebDriver` module setup
409413
- Set dump file paths correctly on Windows machines
410414
- Use correct Chrome and Chromedriver binary paths on Windows machines
411-
- Work around command line length limit on Windows machines to ensure process-based operaitons work correctly
415+
- Work around command line length limit on Windows machines to ensure process-based operations work correctly
412416

413417
## [4.0.4] 2023-09-29;
414418

docs/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Depending on your project PHP compatibility, you have three options to choose fr
33
* Your project supports PHP `7.1` to `7.4`: [migrate to wp-browser version `3.5`](#migrate-from-version-3-to-35)
44
* Your project supports PHP `8.0` or above: [migrate to wp-browser version `4.0`](#migrate-from-version-3-to-4)
55
* You cannot, or do not want, to migrate from version `3` of wp-browser to a new
6-
version: [see how you can lock your reuirements to avoid the upgrade](#staying-on-version-3-lower-than-35)
6+
version: [see how you can lock your requirements to avoid the upgrade](#staying-on-version-3-lower-than-35)
77

88
## Version 3.5 and 4.0
99

docs/modules/WPBrowser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ $I->amOnAdminAjaxPage(['action' => 'my-action', 'data' => ['id' => 23], 'nonce'
145145
#### amOnAdminPage
146146
Signature: `amOnAdminPage(string $page)` : `void`
147147

148-
Go to a page in the admininstration area of the site.
148+
Go to a page in the administration area of the site.
149149

150150
This method will **not** handle authentication to the administration area.
151151

docs/modules/WPWebDriver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ $I->amOnAdminAjaxPage(['action' => 'my-action', 'data' => ['id' => 23], 'nonce'
159159
#### amOnAdminPage
160160
Signature: `amOnAdminPage(string $page)` : `void`
161161

162-
Go to a page in the admininstration area of the site.
162+
Go to a page in the administration area of the site.
163163

164164
This method will **not** handle authentication to the administration area.
165165

docs/v3/levels-of-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class SubmissionHandlingTest extends \Codeception\TestCase\WPTestCase {
140140

141141
$response = $handler->handle( $request );
142142

143-
$this->assertIntsanceOf( WP_REST_Response::class, $response );
143+
$this->assertInstanceOf( WP_REST_Response::class, $response );
144144
$this->assertEquals( 200, $response->get_status() );
145145
$this->assertInstanceOf( Acme\Signup\Submission_Good::class, $handler->last_submission() );
146146
$this->assertEquals( 'luca', $handler->last_submission()->name() );
@@ -154,7 +154,7 @@ class SubmissionHandlingTest extends \Codeception\TestCase\WPTestCase {
154154

155155
$response = $handler->handle( $request );
156156

157-
$this->assertIntsanceOf( WP_REST_Response::class, $response );
157+
$this->assertInstanceOf( WP_REST_Response::class, $response );
158158
$this->assertEquals( 400, $response->get_status() );
159159
$this->assertInstanceOf( Acme\Signup\Submission_Bad::class, $handler->last_submission() );
160160
$this->assertEquals( 'luca', $handler->last_submission()->name() );

docs/v3/modules/WPBrowser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Since this module extends the `PHPBrowser` module provided by Codeception, pleas
8989

9090

9191
* `amOnAdminPage($page)` : `void`
92-
Go to a page in the admininstration area of the site.
92+
Go to a page in the administration area of the site.
9393

9494
This method will **not** handle authentication to the administration area.
9595

docs/v3/modules/WPWebDriver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ modules:
9898

9999

100100
* `amOnAdminPage($page)` : `void`
101-
Go to a page in the admininstration area of the site.
101+
Go to a page in the administration area of the site.
102102

103103
This method will **not** handle authentication to the administration area.
104104

docs/v3/modules/WordPress.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ $I->amOnAdminAjaxPage(['action' => 'my-action', 'data' => ['id' => 23], 'nonce'
165165

166166
<hr>
167167

168-
<p>Go to a page in the admininstration area of the site.</p>
168+
<p>Go to a page in the administration area of the site.</p>
169169
```php
170170
$I->loginAs('user', 'password');
171171
// Go to the plugins management screen.

docs/v3/tutorials/vvv-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If the sanity check above is complete it's time to move to the following part sp
4444

4545
## In and out, host and guest
4646

47-
The Vagrant box provided by VVV goes beyond a simple MySQL, PHP and Ngnix server stack and provides a complete WordPress development environment; tools like [Composer](https://getcomposer.org/), [grunt-cli][4992-0003], and [wp-cli][4992-0006] are ready to use.
47+
The Vagrant box provided by VVV goes beyond a simple MySQL, PHP and Nginx server stack and provides a complete WordPress development environment; tools like [Composer](https://getcomposer.org/), [grunt-cli][4992-0003], and [wp-cli][4992-0006] are ready to use.
4848

4949
This allows the entire development, when it comes to the CLI tools, to happen **in the virtual machine and not outside of it**.
5050

includes/core-phpunit/wp-tests-config.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@
8989
'WP_PLUGIN_DIR' => $wpLoaderConfig['WP_PLUGIN_DIR'] ?? null,
9090
'WPMU_PLUGIN_DIR' => $wpLoaderConfig['WPMU_PLUGIN_DIR'] ?? null,
9191
] as $const => $value) {
92-
if ($value && !defined($const)) {
92+
// DB_PASSWORD can be an empty string for passwordless database users (e.g., root on local development).
93+
$shouldDefine = ($const === 'DB_PASSWORD' && array_key_exists('dbPassword', $wpLoaderConfig)) || $value;
94+
if ($shouldDefine && !defined($const)) {
9395
define($const, $value);
9496
}
9597
}

0 commit comments

Comments
 (0)