Skip to content

Commit eb91cc6

Browse files
committed
add similar tests for the file handler to prove it is working correctly
1 parent 3ff7a12 commit eb91cc6

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/FileHandlerTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,30 @@ public function testDeferredSetManyPersistsAfterPersist(): void
682682
$this->assertSame('deferred@example.com', $data['siteEmail']['value']);
683683
}
684684

685+
public function testDeferredSetReturnsPendingValueBeforePersist(): void
686+
{
687+
$this->settings->set('Example.siteName', 'FileStoredSingle');
688+
689+
$deferredSettings = $this->createDeferredSettings();
690+
691+
$deferredSettings->set('Example.siteName', 'FilePendingSingle');
692+
693+
$this->assertSame('FilePendingSingle', $deferredSettings->get('Example.siteName'));
694+
}
695+
696+
public function testDeferredSetManyReturnsPendingValueBeforePersist(): void
697+
{
698+
$this->settings->set('Example.siteName', 'FileStoredBatch');
699+
700+
$deferredSettings = $this->createDeferredSettings();
701+
702+
$deferredSettings->setMany([
703+
'Example.siteName' => 'FilePendingBatch',
704+
]);
705+
706+
$this->assertSame('FilePendingBatch', $deferredSettings->get('Example.siteName'));
707+
}
708+
685709
public function testDeferredSetManyPersistsDifferentClassesAfterPersist(): void
686710
{
687711
$deferredSettings = $this->createDeferredSettings();

0 commit comments

Comments
 (0)