mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 04:26:02 +03:00
Added delete mailbox method
This commit is contained in:
parent
02af1096b2
commit
0a4f339fcb
@ -473,4 +473,16 @@ class Server
|
||||
{
|
||||
return imap_list($this->getImapStream(), $this->getServerSpecification(), $pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the given mailbox.
|
||||
*
|
||||
* @param $mailbox
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteMailBox($mailbox)
|
||||
{
|
||||
return imap_deletemailbox($this->getImapStream(), $this->getServerSpecification() . $mailbox);
|
||||
}
|
||||
}
|
||||
|
@ -183,6 +183,14 @@ class ServerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($server->hasMailBox('Cheese'), 'Mailbox "Cheese" was created');
|
||||
}
|
||||
|
||||
public function testDeleteMailbox()
|
||||
{
|
||||
$server = Static::getServer();
|
||||
$this->assertTrue($server->hasMailBox('Cheese'), 'Does have mailbox "Cheese"');
|
||||
$this->assertTrue($server->deleteMailBox('Cheese'), 'deleteMailBox returns true.');
|
||||
$this->assertFalse($server->hasMailBox('Cheese'), 'Mailbox "Cheese" was deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user