mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 02:39:21 +03:00
Added Message test structure, as well as a few initial tests.
This commit is contained in:
parent
6ad9945817
commit
83a8a899be
@ -10,6 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Fetch\Test;
|
namespace Fetch\Test;
|
||||||
|
use Fetch\Message;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,10 +19,125 @@ namespace Fetch\Test;
|
|||||||
*/
|
*/
|
||||||
class MessageTest extends \PHPUnit_Framework_TestCase
|
class MessageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
public static function getMessage($id)
|
||||||
|
{
|
||||||
|
$server = ServerTest::getServer();
|
||||||
|
return new \Fetch\Message($id, $server);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testConstructMessage()
|
||||||
|
{
|
||||||
|
$message = static::getMessage(3);
|
||||||
|
$this->assertInstanceOf('\Fetch\Message', $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetOverview()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetHeaders()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetStructure()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function testGetMessageBody()
|
public function testGetMessageBody()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetAddresses()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetDate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetSubject()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testDelete()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetImapBox()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetUid()
|
||||||
|
{
|
||||||
|
$message = static::getMessage('3');
|
||||||
|
$this->assertEquals(3, $message->getUid(), 'Message returns UID');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetAttachments()
|
||||||
|
{
|
||||||
|
$messageWithoutAttachments = static::getMessage('3');
|
||||||
|
$this->assertFalse($messageWithoutAttachments->getAttachments(), 'getAttachments returns false when no attachments present.');
|
||||||
|
|
||||||
|
|
||||||
|
$messageWithAttachments = static::getMessage('6');
|
||||||
|
$attachments = $messageWithAttachments->getAttachments();
|
||||||
|
$this->assertCount(2, $attachments);
|
||||||
|
foreach($attachments as $attachment)
|
||||||
|
$this->assertInstanceOf('\Fetch\Attachment', $attachment, 'getAttachments returns Fetch\Attachment objects.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testCheckFlag()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSetFlag()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testMoveToMailbox()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function testDecode()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testTypeIdToString()
|
||||||
|
{
|
||||||
|
$types = array();
|
||||||
|
$types[0] = 'text';
|
||||||
|
$types[1] = 'multipart';
|
||||||
|
$types[2] = 'message';
|
||||||
|
$types[3] = 'application';
|
||||||
|
$types[4] = 'audio';
|
||||||
|
$types[5] = 'image';
|
||||||
|
$types[6] = 'video';
|
||||||
|
$types[7] = 'other';
|
||||||
|
$types[8] = 'other';
|
||||||
|
$types[32] = 'other';
|
||||||
|
|
||||||
|
foreach($types as $id => $type)
|
||||||
|
$this->assertEquals($type, Message::typeIdToString($id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetParametersFromStructure()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user