Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@@ -9,7 +9,7 @@ use MailPoet\Settings\SettingsController;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class BeaconTest extends \MailPoetTest {
|
||||
function _before() {
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
// create 4 users (1 confirmed, 1 subscribed, 1 unsubscribed, 1 bounced)
|
||||
Subscriber::createOrUpdate([
|
||||
@@ -33,78 +33,78 @@ class BeaconTest extends \MailPoetTest {
|
||||
$this->settings = SettingsController::getInstance();
|
||||
}
|
||||
|
||||
function testItReturnsPhpVersion() {
|
||||
public function testItReturnsPhpVersion() {
|
||||
expect($this->beacon_data['PHP version'])->equals(PHP_VERSION);
|
||||
}
|
||||
|
||||
function testItReturnsMailpoetVersion() {
|
||||
public function testItReturnsMailpoetVersion() {
|
||||
expect($this->beacon_data['MailPoet Free version'])->equals(MAILPOET_VERSION);
|
||||
}
|
||||
|
||||
function testItReturnsWordpressVersion() {
|
||||
public function testItReturnsWordpressVersion() {
|
||||
expect($this->beacon_data['WordPress version'])->equals(get_bloginfo('version'));
|
||||
}
|
||||
|
||||
function testItReturnsDatabaseVersion() {
|
||||
public function testItReturnsDatabaseVersion() {
|
||||
global $wpdb;
|
||||
$db_version = $wpdb->get_var('SELECT @@VERSION');
|
||||
expect($this->beacon_data['Database version'])->equals($db_version);
|
||||
}
|
||||
|
||||
function testItReturnsWpMemoryLimit() {
|
||||
public function testItReturnsWpMemoryLimit() {
|
||||
expect($this->beacon_data['WP_MEMORY_LIMIT'])->equals(WP_MEMORY_LIMIT);
|
||||
}
|
||||
|
||||
function testItReturnsWpMaxMemoryLimit() {
|
||||
public function testItReturnsWpMaxMemoryLimit() {
|
||||
expect($this->beacon_data['WP_MAX_MEMORY_LIMIT'])->equals(WP_MAX_MEMORY_LIMIT);
|
||||
}
|
||||
|
||||
function testItReturnsWpDebugValue() {
|
||||
public function testItReturnsWpDebugValue() {
|
||||
expect($this->beacon_data['WP_DEBUG'])->equals(WP_DEBUG);
|
||||
}
|
||||
|
||||
function testItReturnsPhpMaxExecutionTime() {
|
||||
public function testItReturnsPhpMaxExecutionTime() {
|
||||
expect($this->beacon_data['PHP max_execution_time'])->equals(ini_get('max_execution_time'));
|
||||
}
|
||||
|
||||
function testItReturnsPhpMemoryLimit() {
|
||||
public function testItReturnsPhpMemoryLimit() {
|
||||
expect($this->beacon_data['PHP memory_limit'])->equals(ini_get('memory_limit'));
|
||||
}
|
||||
|
||||
function testItReturnsPhpUploadMaxFilesize() {
|
||||
public function testItReturnsPhpUploadMaxFilesize() {
|
||||
expect($this->beacon_data['PHP upload_max_filesize'])->equals(ini_get('upload_max_filesize'));
|
||||
}
|
||||
|
||||
function testItReturnsPhpPostMaxSize() {
|
||||
public function testItReturnsPhpPostMaxSize() {
|
||||
expect($this->beacon_data['PHP post_max_size'])->equals(ini_get('post_max_size'));
|
||||
}
|
||||
|
||||
function testItReturnsWpLanguage() {
|
||||
public function testItReturnsWpLanguage() {
|
||||
expect($this->beacon_data['WordPress language'])->equals(get_locale());
|
||||
}
|
||||
|
||||
function testItReturnsIfWpIsMultisite() {
|
||||
public function testItReturnsIfWpIsMultisite() {
|
||||
expect($this->beacon_data['Multisite environment?'])->equals(is_multisite() ? 'Yes' : 'No');
|
||||
}
|
||||
|
||||
function testItReturnsCurrentThemeNameAndVersion() {
|
||||
public function testItReturnsCurrentThemeNameAndVersion() {
|
||||
$current_theme = wp_get_theme();
|
||||
expect($this->beacon_data['Current Theme'])->contains($current_theme->get('Name'));
|
||||
expect($this->beacon_data['Current Theme'])->contains($current_theme->get('Version'));
|
||||
}
|
||||
|
||||
function testItReturnsActivePlugins() {
|
||||
public function testItReturnsActivePlugins() {
|
||||
expect($this->beacon_data['Active Plugin names'])->equals(join(", ", get_option('active_plugins')));
|
||||
}
|
||||
|
||||
function testItReturnsSendingMethodDetails() {
|
||||
public function testItReturnsSendingMethodDetails() {
|
||||
$mta = $this->settings->get('mta');
|
||||
expect($this->beacon_data['Sending Method'])->equals($mta['method']);
|
||||
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['emails'] . ' emails');
|
||||
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['interval'] . ' minutes');
|
||||
}
|
||||
|
||||
function testItReturnsSomeSettings() {
|
||||
public function testItReturnsSomeSettings() {
|
||||
expect($this->beacon_data['Task Scheduler method'])->equals($this->settings->get('cron_trigger.method'));
|
||||
expect($this->beacon_data['Default FROM address'])->equals($this->settings->get('sender.address'));
|
||||
expect($this->beacon_data['Default Reply-To address'])->equals($this->settings->get('reply_to.address'));
|
||||
@@ -112,22 +112,22 @@ class BeaconTest extends \MailPoetTest {
|
||||
expect($this->beacon_data['Plugin installed at'])->equals($this->settings->get('installed_at'));
|
||||
}
|
||||
|
||||
function testItReturnsTotalNumberOfSubscribers() {
|
||||
public function testItReturnsTotalNumberOfSubscribers() {
|
||||
// unsubscribed users are not taken into account
|
||||
expect($this->beacon_data['Total number of subscribers'])->equals(2);
|
||||
}
|
||||
|
||||
function testItReturnsWebserverInformation() {
|
||||
public function testItReturnsWebserverInformation() {
|
||||
expect($this->beacon_data['Web server'])->equals(
|
||||
(!empty($_SERVER["SERVER_SOFTWARE"])) ? $_SERVER["SERVER_SOFTWARE"] : 'N/A'
|
||||
);
|
||||
}
|
||||
|
||||
function testItReturnsServerOSInformation() {
|
||||
public function testItReturnsServerOSInformation() {
|
||||
expect($this->beacon_data['Server OS'])->equals(utf8_encode(php_uname()));
|
||||
}
|
||||
|
||||
function testItReturnsCronPingUrl() {
|
||||
public function testItReturnsCronPingUrl() {
|
||||
expect($this->beacon_data['Cron ping URL'])->contains('&action=ping');
|
||||
// cron ping URL should react to custom filters
|
||||
$filter = function($url) {
|
||||
@@ -140,13 +140,13 @@ class BeaconTest extends \MailPoetTest {
|
||||
$wp->removeFilter('mailpoet_cron_request_url', $filter);
|
||||
}
|
||||
|
||||
function testItReturnsPremiumVersion() {
|
||||
public function testItReturnsPremiumVersion() {
|
||||
expect($this->beacon_data['MailPoet Premium version'])->equals(
|
||||
(defined('MAILPOET_PREMIUM_VERSION')) ? MAILPOET_PREMIUM_VERSION : 'N/A'
|
||||
);
|
||||
}
|
||||
|
||||
function testItReturnsPremiumKey() {
|
||||
public function testItReturnsPremiumKey() {
|
||||
expect($this->beacon_data['MailPoet Premium/MSS key'])->equals(
|
||||
$this->settings->get(Bridge::PREMIUM_KEY_SETTING_NAME) ?: $this->settings->get(Bridge::API_KEY_SETTING_NAME)
|
||||
);
|
||||
|
Reference in New Issue
Block a user