Fix integration tests to work with updated codeception/verify

[MAILPOET-3203]
This commit is contained in:
Rostislav Wolny
2020-10-08 13:02:47 +02:00
committed by Veljko V
parent e85b4c6fec
commit 54727ad9a2
52 changed files with 266 additions and 265 deletions

View File

@@ -168,7 +168,7 @@ class NewslettersTest extends \MailPoetTest {
);
$hookName = 'mailpoet_api_newsletters_get_after';
expect(WPHooksHelper::isFilterApplied($hookName))->true();
expect(WPHooksHelper::getFilterApplied($hookName)[0])->internalType('array');
expect(WPHooksHelper::getFilterApplied($hookName)[0])->array();
}
public function testItCanSaveANewsletter() {
@@ -670,7 +670,7 @@ class NewslettersTest extends \MailPoetTest {
]);
$response = $this->endpoint->showPreview($data);
expect($response->meta['preview_url'])->notContains('http');
expect($response->meta['preview_url'])->stringNotContainsString('http');
expect($response->meta['preview_url'])->regExp('!^\/\/!');
}

View File

@@ -81,7 +81,7 @@ class ServicesTest extends \MailPoetTest {
$response = $servicesEndpoint->checkMSSKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_OK);
expect($response->data['message'])
->contains($date->format($servicesEndpoint->dateTime->getDateFormat()));
->stringContainsString($date->format($servicesEndpoint->dateTime->getDateFormat()));
}
public function testItRespondsWithErrorIfServiceIsUnavailableDuringMSSCheck() {
@@ -96,7 +96,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkMSSKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains(
expect($response->errors[0]['message'])->stringContainsString(
$this->invokeMethod(
$servicesEndpoint, 'getErrorDescriptionByCode', [Bridge::CHECK_ERROR_UNAVAILABLE]
)
@@ -115,7 +115,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkMSSKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains(
expect($response->errors[0]['message'])->stringContainsString(
$this->invokeMethod(
$servicesEndpoint, 'getErrorDescriptionByCode', [Bridge::CHECK_ERROR_UNKNOWN]
)
@@ -134,7 +134,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkMSSKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains('404');
expect($response->errors[0]['message'])->stringContainsString('404');
}
public function testItRespondsWithErrorIfMSSCheckThrowsAnException() {
@@ -291,7 +291,7 @@ class ServicesTest extends \MailPoetTest {
$response = $servicesEndpoint->checkPremiumKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_OK);
expect($response->data['message'])
->contains($date->format($servicesEndpoint->dateTime->getDateFormat()));
->stringContainsString($date->format($servicesEndpoint->dateTime->getDateFormat()));
}
public function testItRespondsWithErrorIfServiceIsUnavailableDuringPremiumCheck() {
@@ -306,7 +306,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkPremiumKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains(
expect($response->errors[0]['message'])->stringContainsString(
$this->invokeMethod(
$servicesEndpoint, 'getErrorDescriptionByCode', [Bridge::CHECK_ERROR_UNAVAILABLE]
)
@@ -325,7 +325,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkPremiumKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains(
expect($response->errors[0]['message'])->stringContainsString(
$this->invokeMethod(
$servicesEndpoint, 'getErrorDescriptionByCode', [Bridge::CHECK_ERROR_UNKNOWN]
)
@@ -344,7 +344,7 @@ class ServicesTest extends \MailPoetTest {
$servicesEndpoint = $this->createServicesEndpointWithMocks(['bridge' => $bridge]);
$response = $servicesEndpoint->checkPremiumKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_NOT_FOUND);
expect($response->errors[0]['message'])->contains('404');
expect($response->errors[0]['message'])->stringContainsString('404');
}
public function testItRespondsWithErrorIfPremiumCheckThrowsAnException() {

View File

@@ -82,7 +82,7 @@ class SettingsTest extends \MailPoetTest {
$response = $this->endpoint->get();
expect($response->status)->equals(APIResponse::STATUS_OK);
expect($response->data['some']['setting'])->hasntKey('key');
expect($response->data['some']['setting'])->hasNotKey('key');
expect($response->data['some']['setting']['new_key'])->true();
expect($response->data['some']['new_setting'])->true();
}

View File

@@ -532,7 +532,7 @@ class SubscribersTest extends \MailPoetTest {
]);
} catch (UnexpectedValueException $exception) {
expect($exception->getHttpStatusCode())->equals(APIResponse::STATUS_BAD_REQUEST);
expect($exception->getErrors()[Error::BAD_REQUEST])->contains('Invalid bulk action');
expect($exception->getErrors()[Error::BAD_REQUEST])->stringContainsString('Invalid bulk action');
}
}