Merged in feature/PMCORE-3834 (pull request #8566)
Merging feature/PMCORE-3834 to develop
This commit is contained in:
@@ -19,13 +19,21 @@ class EmailServerTest extends TestCase
|
||||
/**
|
||||
* set up function.
|
||||
*/
|
||||
public function setUp()
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->emailServer = new EmailServer();
|
||||
$this->faker = Factory::create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the tearDown method
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
parent::tearDown(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Get structure for registry the EMAIL_SERVER.
|
||||
* @return array
|
||||
@@ -109,7 +117,7 @@ class EmailServerTest extends TestCase
|
||||
$this->loadUserSession();
|
||||
|
||||
$faker = $this->faker;
|
||||
$emailServer = factory(EmailServerModel::class)->create($this->getDataForEmailServerRegistry());
|
||||
$emailServer = EmailServerModel::factory()->create($this->getDataForEmailServerRegistry());
|
||||
$data = $emailServer->toArray();
|
||||
|
||||
$this->emailServer->setContextLog([
|
||||
@@ -247,7 +255,7 @@ class EmailServerTest extends TestCase
|
||||
$this->emailServer->setContextLog([
|
||||
'workspace' => 'workflow'
|
||||
]);
|
||||
$emailServer = factory(EmailServerModel::class)->create($this->getDataForEmailServerRegistry());
|
||||
$emailServer = EmailServerModel::factory()->create($this->getDataForEmailServerRegistry());
|
||||
$emailServerUid = $emailServer->MESS_UID;
|
||||
$actual = $this->emailServer->getEmailServer($emailServerUid);
|
||||
$this->assertNotEmpty($actual);
|
||||
@@ -264,7 +272,7 @@ class EmailServerTest extends TestCase
|
||||
$this->emailServer->setContextLog([
|
||||
'workspace' => 'workflow'
|
||||
]);
|
||||
$emailServer = factory(EmailServerModel::class)->create($this->getDataForEmailServerRegistry());
|
||||
$emailServer = EmailServerModel::factory()->create($this->getDataForEmailServerRegistry());
|
||||
$emailServerUid = $faker->regexify("/[a-zA-Z]{32}/");
|
||||
|
||||
$this->expectException(Exception::class);
|
||||
@@ -360,7 +368,7 @@ class EmailServerTest extends TestCase
|
||||
$emailServer = new EmailServer();
|
||||
|
||||
// This expects an exception message
|
||||
$this->expectExceptionMessage("Undefined index: MESS_ENGINE");
|
||||
$this->expectExceptionMessage('Undefined array key "MESS_ENGINE"');
|
||||
|
||||
// Call the sendTestMail method
|
||||
$emailServer->sendTestMail($data);
|
||||
@@ -374,7 +382,7 @@ class EmailServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_the_delete_method()
|
||||
{
|
||||
$email = factory(EmailServerModel::class)->create();
|
||||
$email = EmailServerModel::factory()->create();
|
||||
|
||||
$emailServer = new EmailServer();
|
||||
$res = $emailServer->delete($email['MESS_UID']);
|
||||
@@ -393,7 +401,7 @@ class EmailServerTest extends TestCase
|
||||
*/
|
||||
public function it_should_test_the_delete_method_with_imap()
|
||||
{
|
||||
$email = factory(EmailServerModel::class)->create([
|
||||
$email = EmailServerModel::factory()->create([
|
||||
'MESS_ENGINE' => 'IMAP'
|
||||
]);
|
||||
|
||||
@@ -405,12 +413,4 @@ class EmailServerTest extends TestCase
|
||||
$this->expectExceptionMessage("**ID_EMAIL_SERVER_DOES_NOT_EXIST**");
|
||||
$emailServer->getEmailServer($email['MESS_UID']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the tearDown method
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
parent::tearDown(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user