generated from Nodarx/template
feat: implement content cache
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user