mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-22 03:06:02 +03:00
Created initial working test suite
So far it just tests some flags (which it already did) and then tests connecting to the imap server itself. The Attachment and Message tests are just stubs right now and don't do anything, but need those stubs to let the tests occur.
This commit is contained in:
parent
554c22a363
commit
01f5ad02a8
@ -18,5 +18,8 @@ namespace Fetch\Test;
|
||||
*/
|
||||
class AttachmentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testGetData()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -19,4 +19,9 @@ namespace Fetch\Test;
|
||||
class MessageTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testGetMessageBody()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,14 +27,13 @@ class ServerTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFlags($expected, $port, $flags)
|
||||
{
|
||||
$host = 'example.com';
|
||||
$server = new Server($host, $port);
|
||||
$server = new Server(TESTING_SERVER_HOST, $port);
|
||||
|
||||
foreach ($flags as $flag => $value) {
|
||||
$server->setFlag($flag, $value);
|
||||
}
|
||||
|
||||
$this->assertEquals(str_replace('%host%', $host, $expected), $server->getServerString());
|
||||
$this->assertEquals(str_replace('%host%', TESTING_SERVER_HOST, $expected), $server->getServerString());
|
||||
}
|
||||
|
||||
public function flagsDataProvider() {
|
||||
@ -54,4 +53,17 @@ class ServerTest extends \PHPUnit_Framework_TestCase
|
||||
array('{%host%:100}', 100, array('user' => 'foo', 'user' => false)),
|
||||
);
|
||||
}
|
||||
|
||||
public function testConnection()
|
||||
{
|
||||
$server = new Server(TESTING_SERVER_HOST);
|
||||
$server->setAuthentication(TEST_USER, TEST_PASSWORD);
|
||||
$imapSteam = $server->getImapStream();
|
||||
|
||||
#$this->assertInstanceOf('resource', $imapSteam);
|
||||
$this->assertInternalType('resource', $imapSteam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user