feat: implement content cache

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-09-29 19:56:30 -04:00
parent d28800a04e
commit 0250b5a847
10 changed files with 511 additions and 8 deletions
+14
View File
@@ -81,6 +81,20 @@ final class CacheSerializationTest extends TestCase
$this->assertSame(['flagged' => true], $restored->getProperties()->getFlags());
}
public function testIncompleteSectionsRoundTripThroughContentButNotTheApi(): void
{
$entity = $this->entity();
$entity->getProperties()->setIncompleteSections('1');
$content = json_decode(json_encode($entity->toCacheContent()), true);
$restored = (new EntityResource('imap', 'svc'))->fromCacheContent($content);
$this->assertSame(['1'], $content['incomplete']);
$this->assertArrayNotHasKey('incomplete', $content['properties']);
$this->assertSame(['1'], $restored->getProperties()->getIncompleteSections());
$this->assertStringNotContainsString('incomplete', json_encode($restored));
}
public function testContentWithOtherSchemaVersionIsRejected(): void
{
$content = $this->entity()->toCacheContent();