class FakeFolder implements FolderInterface (View source)

Traits

Methods

bool
isSameFolder(FolderInterface $a, FolderInterface $b)

Determine if two folders are the same.

__construct(string $path = '', array $flags = [], array $messages = [], string $delimiter = '/', MailboxInterface|null $mailbox = null)

Constructor.

mailbox()

Get the folder's mailbox.

string
path()

Get the folder path.

array
flags()

Get the folder flags.

string
delimiter()

Get the folder delimiter.

string
name()

Get the folder name.

bool
is(FolderInterface $folder)

Determine if the current folder is the same as the given.

messages()

Begin querying for messages.

void
idle(callable $callback, callable|null $query = null, callable|int $timeout = 300)

Begin idling on the current folder for the given timeout in seconds.

void
poll(callable $callback, callable|null $query = null, callable|int $frequency = 60)

Begin polling for new messages at the given frequency in seconds.

void
move(string $newPath)

Move or rename the current folder.

void
select(bool $force = false)

Select the current folder.

array
status()

Get the folder's status.

array
examine()

Examine the current folder and get detailed status information.

array
expunge()

Expunge the mailbox and return the expunged message sequence numbers.

array
quota()

Get the folder's quotas.

void
delete()

Delete the current folder.

setPath(string $path)

Set the folder's path.

setFlags(array $flags)

Set the folder's flags.

setMailbox(MailboxInterface $mailbox)

Set the folder's mailbox.

setMessages(array $messages)

Set the folder's messages.

array
getMessages()

Get the folder's messages.

void
addMessage(FakeMessage $message)

Add a message to the folder.

setDelimiter(string $delimiter = '/')

Set the folder's delimiter.

Details

protected bool isSameFolder(FolderInterface $a, FolderInterface $b)

Determine if two folders are the same.

Parameters

FolderInterface $a
FolderInterface $b

Return Value

bool

__construct(string $path = '', array $flags = [], array $messages = [], string $delimiter = '/', MailboxInterface|null $mailbox = null)

Constructor.

Parameters

string $path
array $flags
array $messages
string $delimiter
MailboxInterface|null $mailbox

MailboxInterface mailbox()

Get the folder's mailbox.

Return Value

MailboxInterface

string path()

Get the folder path.

Return Value

string

array flags()

Get the folder flags.

Return Value

array

string delimiter()

Get the folder delimiter.

Return Value

string

string name()

Get the folder name.

Return Value

string

bool is(FolderInterface $folder)

Determine if the current folder is the same as the given.

Parameters

FolderInterface $folder

Return Value

bool

MessageQueryInterface messages()

Begin querying for messages.

Return Value

MessageQueryInterface

void idle(callable $callback, callable|null $query = null, callable|int $timeout = 300)

Begin idling on the current folder for the given timeout in seconds.

Parameters

callable $callback
callable|null $query
callable|int $timeout

Return Value

void

void poll(callable $callback, callable|null $query = null, callable|int $frequency = 60)

Begin polling for new messages at the given frequency in seconds.

Parameters

callable $callback
callable|null $query
callable|int $frequency

Return Value

void

void move(string $newPath)

Move or rename the current folder.

Parameters

string $newPath

Return Value

void

void select(bool $force = false)

Select the current folder.

Parameters

bool $force

Return Value

void

array status()

Get the folder's status.

Return Value

array

array examine()

Examine the current folder and get detailed status information.

Return Value

array

array expunge()

Expunge the mailbox and return the expunged message sequence numbers.

Return Value

array

array quota()

Get the folder's quotas.

Return Value

array

void delete()

Delete the current folder.

Return Value

void

FakeFolder setPath(string $path)

Set the folder's path.

Parameters

string $path

Return Value

FakeFolder

FakeFolder setFlags(array $flags)

Set the folder's flags.

Parameters

array $flags

Return Value

FakeFolder

FakeFolder setMailbox(MailboxInterface $mailbox)

Set the folder's mailbox.

Parameters

MailboxInterface $mailbox

Return Value

FakeFolder

FakeFolder setMessages(array $messages)

Set the folder's messages.

Parameters

array $messages

Return Value

FakeFolder

array getMessages()

Get the folder's messages.

Return Value

array

void addMessage(FakeMessage $message)

Add a message to the folder.

Parameters

FakeMessage $message

Return Value

void

FakeFolder setDelimiter(string $delimiter = '/')

Set the folder's delimiter.

Parameters

string $delimiter

Return Value

FakeFolder