Fix integration tests to work with updated codeception/verify
[MAILPOET-3203]
This commit is contained in:
committed by
Veljko V
parent
e85b4c6fec
commit
54727ad9a2
@@ -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('!^\/\/!');
|
||||
}
|
||||
|
||||
|
@@ -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() {
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user