Fix active coding standard rule violations in tests [MAILPOET-981]

This commit is contained in:
stoletniy
2017-07-03 16:20:44 +03:00
parent a49a230983
commit 29491dfd3e
13 changed files with 38 additions and 39 deletions

View File

@ -108,7 +108,7 @@ class ServicesTest extends MailPoetTest {
);
$response = $this->services_endpoint->checkPremiumKey($this->data);
expect($response->status)->equals(APIResponse::STATUS_OK);
foreach (array_keys(Installer::getPremiumStatus()) as $key) {
foreach(array_keys(Installer::getPremiumStatus()) as $key) {
expect(isset($response->meta[$key]))->true();
}
}

View File

@ -19,7 +19,7 @@ class BounceTest extends MailPoetTest {
'good_address@example.com'
);
foreach ($this->emails as $email) {
foreach($this->emails as $email) {
Subscriber::createOrUpdate(array(
'status' => Subscriber::STATUS_SUBSCRIBED,
'email' => $email

View File

@ -114,6 +114,7 @@ class SendingQueueTest extends MailPoetTest {
$sending_queue_worker->process();
self::fail('Execution limits function was not called.');
} catch(\Exception $e) {
// No exception handling needed
}
}

View File

@ -1,4 +1,3 @@
<?php
use Carbon\Carbon;
@ -324,7 +323,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
'monthDay' => null,
'nthWeekDay' => null,
'weekDay' => null,
'timeOfDay' => 50400 // 14:00
'timeOfDay' => 50400 // 2 p.m.
);
Scheduler::processPostNotificationSchedule($newsletter);
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
@ -341,7 +340,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
'monthDay' => null,
'nthWeekDay' => null,
'weekDay' => Carbon::TUESDAY,
'timeOfDay' => 50400 // 14:00
'timeOfDay' => 50400 // 2 p.m.
);
Scheduler::processPostNotificationSchedule($newsletter);
$current_time = Carbon::createFromTimestamp(current_time('timestamp'));
@ -359,7 +358,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
'monthDay' => 19, // 20th (count starts from 0)
'nthWeekDay' => null,
'weekDay' => null,
'timeOfDay' => 50400 // 14:00
'timeOfDay' => 50400 // 2 p.m.
);
Scheduler::processPostNotificationSchedule($newsletter);
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
@ -376,7 +375,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
'monthDay' => null,
'nthWeekDay' => 'L', // L = last
'weekDay' => Carbon::SATURDAY,
'timeOfDay' => 50400 // 14:00
'timeOfDay' => 50400 // 2 p.m.
);
Scheduler::processPostNotificationSchedule($newsletter);
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)

View File

@ -100,7 +100,7 @@ class FrontRouterTest extends MailPoetTest {
function testItExecutesUrlParameterConflictResolverAction() {
$data = array('data' => 'dummy data');
$result = $this->router->init();
expect((boolean) did_action('mailpoet_conflict_resolver_router_url_query_parameters'))->true();
expect((boolean)did_action('mailpoet_conflict_resolver_router_url_query_parameters'))->true();
}
function testItCanEncodeRequestData() {

View File

@ -143,8 +143,7 @@ class ExportTest extends MailPoetTest {
'|' .
preg_quote(Env::$temp_url, '|') . '/' .
basename($this->export->export_file) .
'|'
, $this->export->export_file_URL)
'|', $this->export->export_file_URL)
)->equals(1);
expect($this->export->subscriber_batch_size)->notNull();
}

View File

@ -166,7 +166,7 @@ class ImportTest extends MailPoetTest {
'email' => 'sTeve.sorrow@exaMple.com'
),
);
foreach($subscribers_data_existing as $i=>$existing_subscriber) {
foreach($subscribers_data_existing as $i => $existing_subscriber) {
$subscriber = Subscriber::create();
$subscriber->hydrate($existing_subscriber);
$subscriber->save();
@ -180,7 +180,7 @@ class ImportTest extends MailPoetTest {
);
expect($existing_subscribers['email'][0])->equals($subscribers_data['email'][2]);
expect($existing_subscribers['email'][1])->equals($subscribers_data['email'][3]);
foreach($new_subscribers as $field=>$value) {
foreach($new_subscribers as $field => $value) {
expect($value[0])->equals($subscribers_data[$field][0]);
}
expect($wp_users)->equals(array($subscribers_data_existing[0]['wp_user_id']));

View File

@ -57,7 +57,7 @@ class DateTimeTest extends MailPoetTest {
$one_hour_interval = array_keys($this->date_time->getTimeInterval(
'00:00:00',
'+1 hour',
$total_steps=5
$total_steps = 5
));
$one_hour_expected = array(
'00:00:00', '01:00:00', '02:00:00', '03:00:00', '04:00:00');
@ -66,7 +66,7 @@ class DateTimeTest extends MailPoetTest {
$quarter_hour_interval = array_keys($this->date_time->getTimeInterval(
'00:00:00',
'+15 minute',
$total_steps=5
$total_steps = 5
));
$quarter_hour_expected = array(
'00:00:00', '00:15:00', '00:30:00', '00:45:00', '01:00:00',
@ -76,7 +76,7 @@ class DateTimeTest extends MailPoetTest {
$offset_start_time_interval = array_keys($this->date_time->getTimeInterval(
'03:00:00',
'+1 hour',
$total_steps=5
$total_steps = 5
));
$offset_start_time_expected = array(
'03:00:00', '04:00:00', '05:00:00', '06:00:00', '07:00:00',