fix: gespeichertes false (Divi-Standardschrift) gilt in Theme-Optionen get/update als nicht gesetzt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
879ca752e7
commit
dab4a9ba2e
@@ -280,6 +280,22 @@ final class DiviThemeOptionsUpdateAbilityTest extends TestCase
|
||||
self::assertSame([], $this->writes);
|
||||
}
|
||||
|
||||
/** A stored false (Divi's default font) is "not set": null is no change, a font is "added". */
|
||||
public function testAStoredFalseCountsAsNotSet(): void
|
||||
{
|
||||
$this->stored = ['heading_font' => false] + $this->stored;
|
||||
|
||||
self::assertSame([], $this->ability()->execute(['set' => ['heading_font' => null]])['diff']);
|
||||
$dry = self::assertToolError(
|
||||
$this->ability()->execute(['set' => ['heading_font' => 'Roboto']]),
|
||||
'confirm_required'
|
||||
);
|
||||
self::assertSame([['heading_font', 'added']], array_map(
|
||||
static fn (array $row): array => [$row['key'], $row['action']],
|
||||
$dry['diff']
|
||||
));
|
||||
}
|
||||
|
||||
public function testUnchangedValuesAreNoChange(): void
|
||||
{
|
||||
$result = $this->ability()->execute(['set' => ['body_font_size' => 16, 'gutter_width' => null]]);
|
||||
|
||||
Reference in New Issue
Block a user