PMCORE-959

This commit is contained in:
Andrea Adamczyk
2020-04-17 09:38:03 -04:00
parent b7586c06f0
commit 890e0c9e8e
11 changed files with 330 additions and 5 deletions

View File

@@ -364,6 +364,46 @@ class EmailServerTest extends TestCase
$emailServer->sendTestMail($data);
}
/**
* It test the delete method
*
* @covers \ProcessMaker\BusinessModel\EmailServer::delete()
* @test
*/
public function it_should_test_the_delete_method()
{
$email = factory(EmailServerModel::class)->create();
$emailServer = new EmailServer();
$res = $emailServer->delete($email['MESS_UID']);
$this->assertNull($res);
$this->expectExceptionMessage("**ID_EMAIL_SERVER_DOES_NOT_EXIST**");
$emailServer->getEmailServer($email['MESS_UID']);
}
/**
* It test the delete method with an IMAP email server
*
* @covers \ProcessMaker\BusinessModel\EmailServer::delete()
* @test
*/
public function it_should_test_the_delete_method_with_imap()
{
$email = factory(EmailServerModel::class)->create([
'MESS_ENGINE' => 'IMAP'
]);
$emailServer = new EmailServer();
$res = $emailServer->delete($email['MESS_UID']);
$this->assertNull($res);
$this->expectExceptionMessage("**ID_EMAIL_SERVER_DOES_NOT_EXIST**");
$emailServer->getEmailServer($email['MESS_UID']);
}
/**
* Call the tearDown method
*/