fix: Task 5 review round 1 - restore point inside the kses window, strict map field types (S37)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,11 +20,17 @@ final class DiviFlagsTest extends TestCase
|
||||
|
||||
return false;
|
||||
});
|
||||
Functions\when('get_post_meta')->justReturn('on');
|
||||
Functions\when('get_post_meta')->alias(
|
||||
static fn (int $id, string $key): string => $key === '_et_pb_show_page_creation' ? 'off' : 'on'
|
||||
);
|
||||
|
||||
DiviFlags::set(7);
|
||||
|
||||
self::assertSame(['7:_et_pb_use_divi_5=on', '7:_et_pb_use_builder=on'], $written);
|
||||
// Like Divi's own save (SyncToServerController.php:382-387), incl. the page creation flow flag.
|
||||
self::assertSame(
|
||||
['7:_et_pb_use_divi_5=on', '7:_et_pb_use_builder=on', '7:_et_pb_show_page_creation=off'],
|
||||
$written
|
||||
);
|
||||
}
|
||||
|
||||
public function testThrowsWhenAFlagDoesNotReadBack(): void
|
||||
@@ -38,4 +44,15 @@ final class DiviFlagsTest extends TestCase
|
||||
$this->expectExceptionMessage('_et_pb_use_builder');
|
||||
DiviFlags::set(7);
|
||||
}
|
||||
|
||||
public function testThrowsWhenThePageCreationFlagDoesNotReadBack(): void
|
||||
{
|
||||
Functions\when('update_post_meta')->justReturn(true);
|
||||
Functions\when('get_post_meta')->justReturn('on');
|
||||
|
||||
$this->expectException(RuntimeException::class);
|
||||
$this->expectExceptionMessage('_et_pb_show_page_creation');
|
||||
DiviFlags::set(7);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user