Mark network tests as skipped

Instead of silently returning

[MAILPOET-2358]
This commit is contained in:
Pavel Dohnal
2019-09-17 15:11:37 +02:00
committed by Jack Kitterhing
parent 3b390e9d88
commit 227ec2adc9
4 changed files with 14 additions and 14 deletions

View File

@@ -47,7 +47,7 @@ class MailChimpTest extends \MailPoetUnitTest {
}
function testItFailsWithIncorrectAPIKey() {
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
try {
$mailchimp = clone($this->mailchimp);
@@ -60,7 +60,7 @@ class MailChimpTest extends \MailPoetUnitTest {
}
function testItCanGetLists() {
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
try {
$lists = $this->mailchimp->getLists();
} catch (\Exception $e) {
@@ -72,7 +72,7 @@ class MailChimpTest extends \MailPoetUnitTest {
}
function testItFailsWithIncorrectLists() {
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
try {
$this->mailchimp->getSubscribers();
@@ -90,7 +90,7 @@ class MailChimpTest extends \MailPoetUnitTest {
}
function testItCanGetSubscribers() {
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
try {
$subscribers = $this->mailchimp->getSubscribers([$this->lists[0]]);
@@ -106,7 +106,7 @@ class MailChimpTest extends \MailPoetUnitTest {
}
function testItFailsWhenSubscribersDataTooLarge() {
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
$mailchimp = clone($this->mailchimp);
$mailchimp->max_post_size = 10;