Returns ping response body instead of boolean

This commit is contained in:
Vlad
2017-09-10 18:49:15 -04:00
parent 6c62459ed4
commit 52470360a1
2 changed files with 2 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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() {