Commit 14ff782
Fix callMethodOnDumper treating false config values as no-argument calls (#1961)
* Fix callMethodOnDumper treating false as no-argument call
When a dump config option like skip_ssl is set to false, callMethodOnDumper
was calling the method with no arguments because of the falsy check:
if (! $methodValue) { $dbDumper->$methodName(); }
setSkipSsl() has a default parameter of true, so calling it with no
arguments sets skipSsl to true even when the config says false.
Change the check to $methodValue === null so only genuinely absent
values (flag-style options like use_single_transaction) invoke
the no-argument form. Falsy values like false and 0 are now passed
through correctly.
Fixes: #1946
* Reset custom dumpers in beforeEach to fix test isolation
The 'custom dumpers' test registers a MongoDb factory for 'mysql'
via the static $custom property, which persisted into subsequent
tests causing the skip_ssl test to get a MongoDb instance instead
of MySql.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Freek Van der Herten <freek@spatie.be>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 28f078d commit 14ff782
File tree
2 files changed
+28
-1
lines changed- src/Tasks/Backup
- tests
2 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
0 commit comments