Introduce phpstan-type for MailerLog data

[MAILPOET-4122]
This commit is contained in:
David Remer
2022-03-09 08:55:43 +02:00
committed by Veljko V
parent 53da8bf999
commit ac52f2af99
7 changed files with 158 additions and 55 deletions

View File

@@ -123,7 +123,10 @@ class AuthorizedEmailsControllerTest extends \MailPoetTest {
$controller = $this->getController($authorizedEmailsFromApi = ['auth@email.com']);
$controller->checkAuthorizedEmailAddresses();
$error = MailerLog::getError();
expect($error['operation'])->equals(MailerError::OPERATION_SEND);
expect(is_array($error));
if (is_array($error)) {
expect($error['operation'])->equals(MailerError::OPERATION_SEND);
}
}
public function testItDoesNotResetMailerLogItErrorPersists() {
@@ -135,7 +138,10 @@ class AuthorizedEmailsControllerTest extends \MailPoetTest {
$controller = $this->getController($authorizedEmailsFromApi = ['auth@email.com']);
$controller->checkAuthorizedEmailAddresses();
$error = MailerLog::getError();
expect($error['operation'])->equals(MailerError::OPERATION_AUTHORIZATION);
expect(is_array($error));
if (is_array($error)) {
expect($error['operation'])->equals(MailerError::OPERATION_AUTHORIZATION);
}
}
private function checkUnauthorizedInNewsletter($type, $status) {