Replace expect()->hasNotKey() with verify()->arrayHasNotKey()
codeception/verify 2.1 removed support for expect()->hasNotKey() so we need to replace it with verify()->arrayHasNotKey(). [MAILPOET-5664]
This commit is contained in:
committed by
David Remer
parent
525495409c
commit
c41e5c7d0f
@@ -128,7 +128,7 @@ class SettingsTest extends \MailPoetTest {
|
||||
|
||||
$response = $this->endpoint->get();
|
||||
verify($response->status)->equals(APIResponse::STATUS_OK);
|
||||
expect($response->data['some']['setting'])->hasNotKey('key');
|
||||
verify($response->data['some']['setting'])->arrayHasNotKey('key');
|
||||
verify($response->data['some']['setting']['new_key'])->true();
|
||||
verify($response->data['some']['new_setting'])->true();
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ class AutomaticEmailsTest extends \MailPoetTest {
|
||||
|
||||
$result = $this->AM->getAutomaticEmails();
|
||||
verify($result)->arrayHasKey('email1');
|
||||
expect($result)->hasNotKey('email2');
|
||||
verify($result)->arrayHasNotKey('email2');
|
||||
|
||||
$this->wp->removeAllFilters('mailpoet_automatic_email_test1');
|
||||
$this->wp->removeAllFilters('mailpoet_automatic_email_test2');
|
||||
|
@@ -96,8 +96,8 @@ class WooCommerceTest extends \MailPoetTest {
|
||||
$AM = new AutomaticEmails(new WPFunctions(), $this->automaticEmailFactory);
|
||||
$result = $AM->getAutomaticEmailBySlug('woocommerce');
|
||||
foreach ($result['events'] as $event) {
|
||||
expect($event)->hasNotKey('actionButtonTitle');
|
||||
expect($event)->hasNotKey('actionButtonLink');
|
||||
verify($event)->arrayHasNotKey('actionButtonTitle');
|
||||
verify($event)->arrayHasNotKey('actionButtonLink');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ class ConnectionFactoryTest extends \MailPoetTest {
|
||||
Env::$dbCharset = '';
|
||||
$connectionFactory = new ConnectionFactory();
|
||||
$connection = $connectionFactory->createConnection();
|
||||
expect($connection->getParams())->hasNotKey('charset');
|
||||
verify($connection->getParams())->arrayHasNotKey('charset');
|
||||
}
|
||||
|
||||
public function testItSetsUpSocket() {
|
||||
|
@@ -148,8 +148,8 @@ class TrackerTest extends \MailPoetTest {
|
||||
verify($mailPoetData['campaign_' . $notificationParent->getId() . '_type'])->equals($notificationParent->getType());
|
||||
verify($mailPoetData['campaign_' . $notificationParent->getId() . '_orders_count'])->equals(2);
|
||||
|
||||
expect($mailPoetData)->hasNotKey('campaign_' . $notificationHistory1->getId() . '_revenue');
|
||||
expect($mailPoetData)->hasNotKey('campaign_' . $notificationHistory2->getId() . '_revenue');
|
||||
verify($mailPoetData)->arrayHasNotKey('campaign_' . $notificationHistory1->getId() . '_revenue');
|
||||
verify($mailPoetData)->arrayHasNotKey('campaign_' . $notificationHistory2->getId() . '_revenue');
|
||||
}
|
||||
|
||||
public function testItTracksOnlyTheMainShopCurrency(): void {
|
||||
@@ -189,7 +189,7 @@ class TrackerTest extends \MailPoetTest {
|
||||
verify($mailPoetData['campaign_' . $newsletter2->getId() . '_type'])->equals($newsletter2->getType());
|
||||
verify($mailPoetData['campaign_' . $newsletter2->getId() . '_orders_count'])->equals(1);
|
||||
|
||||
expect($mailPoetData)->hasNotKey('campaign_' . $newsletter3->getId() . '_revenue');
|
||||
verify($mailPoetData)->arrayHasNotKey('campaign_' . $newsletter3->getId() . '_revenue');
|
||||
}
|
||||
|
||||
public function testItTracksTheRevenueOfDeletedCampaigns(): void {
|
||||
|
@@ -72,7 +72,7 @@ class ApiDataSanitizerTest extends \MailPoetUnitTest {
|
||||
|
||||
public function testItIgnoresUnknownProperties() {
|
||||
$result = $this->sanitizer->sanitize(['name' => 'Name', 'type' => 'text', 'unknown' => 'Unknown property']);
|
||||
expect($result)->hasNotKey('unknown');
|
||||
verify($result)->arrayHasNotKey('unknown');
|
||||
}
|
||||
|
||||
public function testItReturnsParamsIfPassed() {
|
||||
@@ -90,7 +90,7 @@ class ApiDataSanitizerTest extends \MailPoetUnitTest {
|
||||
public function testItIgnoresUnknownParams() {
|
||||
$result = $this->sanitizer->sanitize(['name' => 'Name', 'type' => 'text', 'params' => ['unknown' => 'Unknown property']]);
|
||||
verify($result)->arrayHasKey('params');
|
||||
expect($result['params'])->hasNotKey('unknown');
|
||||
verify($result['params'])->arrayHasNotKey('unknown');
|
||||
}
|
||||
|
||||
public function testItFillsLabel() {
|
||||
|
Reference in New Issue
Block a user