Returns ping response body instead of boolean
This commit is contained in:
@@ -61,7 +61,7 @@ class CronHelper {
|
|||||||
'user-agent' => 'MailPoet (www.mailpoet.com) Cron'
|
'user-agent' => 'MailPoet (www.mailpoet.com) Cron'
|
||||||
);
|
);
|
||||||
$result = wp_remote_get($url, $args);
|
$result = wp_remote_get($url, $args);
|
||||||
return wp_remote_retrieve_body($result) === 'pong';
|
return wp_remote_retrieve_body($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function accessDaemon($token, $timeout = self::DAEMON_REQUEST_TIMEOUT) {
|
static function accessDaemon($token, $timeout = self::DAEMON_REQUEST_TIMEOUT) {
|
||||||
|
@@ -124,7 +124,7 @@ class CronHelperTest extends \MailPoetTest {
|
|||||||
|
|
||||||
function testItPingsDaemon() {
|
function testItPingsDaemon() {
|
||||||
if(getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
if(getenv('WP_TEST_ENABLE_NETWORK_TESTS') !== 'true') return;
|
||||||
expect(CronHelper::pingDaemon())->true();
|
expect(CronHelper::pingDaemon())->equals('pong');
|
||||||
}
|
}
|
||||||
|
|
||||||
function _after() {
|
function _after() {
|
||||||
|
Reference in New Issue
Block a user