Skip to content

Commit 878e3e9

Browse files
Copilotswissspidy
andcommitted
Address code review feedback: handle null values and improve test
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent a265c7d commit 878e3e9

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

features/db-check.feature

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,15 @@ Feature: Check the database
152152
"""
153153

154154
When I run `wp db check --debug`
155-
Then STDERR should not contain:
155+
Then STDERR should contain:
156+
"""
157+
Debug (db): Final MySQL command:
158+
"""
159+
And STDERR should not contain:
160+
"""
161+
--default-character-set=''
162+
"""
163+
And STDERR should not contain:
156164
"""
157165
--default-character-set=
158166
"""

src/DB_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $int
18321832
$required = array_filter(
18331833
$required,
18341834
static function ( $value ) {
1835-
return '' !== $value;
1835+
return null !== $value && '' !== $value;
18361836
}
18371837
);
18381838

0 commit comments

Comments
 (0)