fix: verify option writes before treating update_option() false as failure
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -71,6 +71,17 @@ final class SettingsWhitelistTest extends TestCase
|
||||
self::assertSame('', $whitelist->normalize('WPLANG', 'en_US'));
|
||||
}
|
||||
|
||||
public function testWplangAcceptsOnlyTheEnUsSentinelNotTheRawEmptyString(): void
|
||||
{
|
||||
// '' is WordPress' internal storage form for English (see current()/normalize());
|
||||
// clients must say en_US, never the internal '', which is also not an installed
|
||||
// language code and would otherwise be rejected as "not installed" anyway.
|
||||
Functions\when('get_available_languages')->justReturn(['de_DE']);
|
||||
$whitelist = new SettingsWhitelist();
|
||||
|
||||
self::assertNotNull($whitelist->validate('WPLANG', '', []));
|
||||
}
|
||||
|
||||
public function testCurrentNormalizesLanguageAndNumbers(): void
|
||||
{
|
||||
Functions\when('get_option')->alias(static fn (string $key) => ['WPLANG' => '', 'page_on_front' => '5'][$key]);
|
||||
|
||||
Reference in New Issue
Block a user