Mark network tests as skipped
Instead of silently returning [MAILPOET-2358]
This commit is contained in:
committed by
Jack Kitterhing
parent
3b390e9d88
commit
227ec2adc9
@ -228,7 +228,7 @@ class CronHelperTest extends \MailPoetTest {
|
||||
$site_url = 'http://example.com';
|
||||
expect(CronHelper::getSiteUrl($site_url))->equals($site_url);
|
||||
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
|
||||
// 2. when url contains valid port, try connecting to it
|
||||
$site_url = 'http://example.com:80';
|
||||
@ -308,7 +308,7 @@ class CronHelperTest extends \MailPoetTest {
|
||||
}
|
||||
|
||||
function testItPingsDaemon() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
// raw response is returned
|
||||
expect(CronHelper::pingDaemon())->equals(DaemonHttpRunner::PING_SUCCESS_RESPONSE);
|
||||
}
|
||||
|
@ -23,34 +23,34 @@ class SupervisorTest extends \MailPoetTest {
|
||||
}
|
||||
|
||||
function testItCanConstruct() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
$supervisor = new Supervisor();
|
||||
expect($supervisor->token)->notEmpty();
|
||||
expect($supervisor->daemon)->notEmpty();
|
||||
}
|
||||
|
||||
function testItCreatesDaemonWhenOneDoesNotExist() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
expect($this->settings->get(CronHelper::DAEMON_SETTING))->null();
|
||||
$supervisor = new Supervisor();
|
||||
expect($supervisor->getDaemon())->notEmpty();
|
||||
}
|
||||
|
||||
function testItReturnsDaemonWhenOneExists() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
$supervisor = new Supervisor();
|
||||
expect($supervisor->getDaemon())->equals($supervisor->daemon);
|
||||
}
|
||||
|
||||
function testItDoesNothingWhenDaemonExecutionDurationIsBelowLimit() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
$supervisor = new Supervisor();
|
||||
expect($supervisor->checkDaemon())
|
||||
->equals($supervisor->daemon);
|
||||
}
|
||||
|
||||
function testRestartsDaemonWhenExecutionDurationIsAboveLimit() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
$supervisor = new Supervisor();
|
||||
$supervisor->daemon['updated_at'] = time() - CronHelper::DAEMON_EXECUTION_TIMEOUT;
|
||||
$daemon = $supervisor->checkDaemon();
|
||||
@ -60,7 +60,7 @@ class SupervisorTest extends \MailPoetTest {
|
||||
}
|
||||
|
||||
function testRestartsDaemonWhenItIsInactive() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
$supervisor = new Supervisor();
|
||||
$supervisor->daemon['updated_at'] = time();
|
||||
$supervisor->daemon['status'] = CronHelper::DAEMON_STATUS_INACTIVE;
|
||||
|
@ -260,7 +260,7 @@ class BridgeTest extends \MailPoetTest {
|
||||
}
|
||||
|
||||
function testItPingsBridge() {
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||
if (getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') $this->markTestSkipped();
|
||||
expect(Bridge::pingBridge())->true();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user