generated from Nodarx/template
feat: serve message lists from the cache
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ namespace KTXT\ProviderImap\Tests\Support;
|
||||
|
||||
use Generator;
|
||||
use KTXF\Resource\Filter\IFilter;
|
||||
use KTXF\Resource\Range\IRange;
|
||||
use KTXF\Resource\Sort\ISort;
|
||||
use KTXM\ProviderImap\Client\Mailbox;
|
||||
use KTXM\ProviderImap\Client\Protocol\Command\Argument\FetchOptions;
|
||||
@@ -75,6 +76,26 @@ final class FakeLiveMailService extends LiveMailService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Every message of the mailbox in UID order; filter / sort / range are not evaluated.
|
||||
*/
|
||||
public function messageList(string $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null): Generator
|
||||
{
|
||||
$this->calls[] = ['messageList', [$collection]];
|
||||
$uids = array_keys($this->flags);
|
||||
sort($uids);
|
||||
yield from $this->messageFetch($collection, null, ...$uids);
|
||||
}
|
||||
|
||||
/** @var int[] UIDs entityFind() returns */
|
||||
public array $found = [];
|
||||
|
||||
public function entityFind(string $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null): array
|
||||
{
|
||||
$this->calls[] = ['entityFind', [$collection, $filter]];
|
||||
return $this->found;
|
||||
}
|
||||
|
||||
public function entityPatch(string $collection, array $flagsToAdd = [], array $flagsToRemove = [], int ...$uids): void
|
||||
{
|
||||
$this->calls[] = ['entityPatch', [$collection, $flagsToAdd, $flagsToRemove, $uids]];
|
||||
|
||||
Reference in New Issue
Block a user