Fix active coding standard rule violations in tests [MAILPOET-981]
This commit is contained in:
@ -108,7 +108,7 @@ class ServicesTest extends MailPoetTest {
|
|||||||
);
|
);
|
||||||
$response = $this->services_endpoint->checkPremiumKey($this->data);
|
$response = $this->services_endpoint->checkPremiumKey($this->data);
|
||||||
expect($response->status)->equals(APIResponse::STATUS_OK);
|
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();
|
expect(isset($response->meta[$key]))->true();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ class BounceTest extends MailPoetTest {
|
|||||||
'good_address@example.com'
|
'good_address@example.com'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($this->emails as $email) {
|
foreach($this->emails as $email) {
|
||||||
Subscriber::createOrUpdate(array(
|
Subscriber::createOrUpdate(array(
|
||||||
'status' => Subscriber::STATUS_SUBSCRIBED,
|
'status' => Subscriber::STATUS_SUBSCRIBED,
|
||||||
'email' => $email
|
'email' => $email
|
||||||
|
@ -114,6 +114,7 @@ class SendingQueueTest extends MailPoetTest {
|
|||||||
$sending_queue_worker->process();
|
$sending_queue_worker->process();
|
||||||
self::fail('Execution limits function was not called.');
|
self::fail('Execution limits function was not called.');
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
|
// No exception handling needed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
@ -324,7 +323,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
|
|||||||
'monthDay' => null,
|
'monthDay' => null,
|
||||||
'nthWeekDay' => null,
|
'nthWeekDay' => null,
|
||||||
'weekDay' => null,
|
'weekDay' => null,
|
||||||
'timeOfDay' => 50400 // 14:00
|
'timeOfDay' => 50400 // 2 p.m.
|
||||||
);
|
);
|
||||||
Scheduler::processPostNotificationSchedule($newsletter);
|
Scheduler::processPostNotificationSchedule($newsletter);
|
||||||
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
||||||
@ -341,7 +340,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
|
|||||||
'monthDay' => null,
|
'monthDay' => null,
|
||||||
'nthWeekDay' => null,
|
'nthWeekDay' => null,
|
||||||
'weekDay' => Carbon::TUESDAY,
|
'weekDay' => Carbon::TUESDAY,
|
||||||
'timeOfDay' => 50400 // 14:00
|
'timeOfDay' => 50400 // 2 p.m.
|
||||||
);
|
);
|
||||||
Scheduler::processPostNotificationSchedule($newsletter);
|
Scheduler::processPostNotificationSchedule($newsletter);
|
||||||
$current_time = Carbon::createFromTimestamp(current_time('timestamp'));
|
$current_time = Carbon::createFromTimestamp(current_time('timestamp'));
|
||||||
@ -359,7 +358,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
|
|||||||
'monthDay' => 19, // 20th (count starts from 0)
|
'monthDay' => 19, // 20th (count starts from 0)
|
||||||
'nthWeekDay' => null,
|
'nthWeekDay' => null,
|
||||||
'weekDay' => null,
|
'weekDay' => null,
|
||||||
'timeOfDay' => 50400 // 14:00
|
'timeOfDay' => 50400 // 2 p.m.
|
||||||
);
|
);
|
||||||
Scheduler::processPostNotificationSchedule($newsletter);
|
Scheduler::processPostNotificationSchedule($newsletter);
|
||||||
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
||||||
@ -376,7 +375,7 @@ class NewsletterSchedulerTest extends MailPoetTest {
|
|||||||
'monthDay' => null,
|
'monthDay' => null,
|
||||||
'nthWeekDay' => 'L', // L = last
|
'nthWeekDay' => 'L', // L = last
|
||||||
'weekDay' => Carbon::SATURDAY,
|
'weekDay' => Carbon::SATURDAY,
|
||||||
'timeOfDay' => 50400 // 14:00
|
'timeOfDay' => 50400 // 2 p.m.
|
||||||
);
|
);
|
||||||
Scheduler::processPostNotificationSchedule($newsletter);
|
Scheduler::processPostNotificationSchedule($newsletter);
|
||||||
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
$newsletter_option = NewsletterOption::where('newsletter_id', $newsletter->id)
|
||||||
|
@ -100,7 +100,7 @@ class FrontRouterTest extends MailPoetTest {
|
|||||||
function testItExecutesUrlParameterConflictResolverAction() {
|
function testItExecutesUrlParameterConflictResolverAction() {
|
||||||
$data = array('data' => 'dummy data');
|
$data = array('data' => 'dummy data');
|
||||||
$result = $this->router->init();
|
$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() {
|
function testItCanEncodeRequestData() {
|
||||||
|
@ -143,8 +143,7 @@ class ExportTest extends MailPoetTest {
|
|||||||
'|' .
|
'|' .
|
||||||
preg_quote(Env::$temp_url, '|') . '/' .
|
preg_quote(Env::$temp_url, '|') . '/' .
|
||||||
basename($this->export->export_file) .
|
basename($this->export->export_file) .
|
||||||
'|'
|
'|', $this->export->export_file_URL)
|
||||||
, $this->export->export_file_URL)
|
|
||||||
)->equals(1);
|
)->equals(1);
|
||||||
expect($this->export->subscriber_batch_size)->notNull();
|
expect($this->export->subscriber_batch_size)->notNull();
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ class ImportTest extends MailPoetTest {
|
|||||||
'email' => 'sTeve.sorrow@exaMple.com'
|
'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 = Subscriber::create();
|
||||||
$subscriber->hydrate($existing_subscriber);
|
$subscriber->hydrate($existing_subscriber);
|
||||||
$subscriber->save();
|
$subscriber->save();
|
||||||
@ -180,7 +180,7 @@ class ImportTest extends MailPoetTest {
|
|||||||
);
|
);
|
||||||
expect($existing_subscribers['email'][0])->equals($subscribers_data['email'][2]);
|
expect($existing_subscribers['email'][0])->equals($subscribers_data['email'][2]);
|
||||||
expect($existing_subscribers['email'][1])->equals($subscribers_data['email'][3]);
|
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($value[0])->equals($subscribers_data[$field][0]);
|
||||||
}
|
}
|
||||||
expect($wp_users)->equals(array($subscribers_data_existing[0]['wp_user_id']));
|
expect($wp_users)->equals(array($subscribers_data_existing[0]['wp_user_id']));
|
||||||
|
@ -57,7 +57,7 @@ class DateTimeTest extends MailPoetTest {
|
|||||||
$one_hour_interval = array_keys($this->date_time->getTimeInterval(
|
$one_hour_interval = array_keys($this->date_time->getTimeInterval(
|
||||||
'00:00:00',
|
'00:00:00',
|
||||||
'+1 hour',
|
'+1 hour',
|
||||||
$total_steps=5
|
$total_steps = 5
|
||||||
));
|
));
|
||||||
$one_hour_expected = array(
|
$one_hour_expected = array(
|
||||||
'00:00:00', '01:00:00', '02:00:00', '03:00:00', '04:00:00');
|
'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(
|
$quarter_hour_interval = array_keys($this->date_time->getTimeInterval(
|
||||||
'00:00:00',
|
'00:00:00',
|
||||||
'+15 minute',
|
'+15 minute',
|
||||||
$total_steps=5
|
$total_steps = 5
|
||||||
));
|
));
|
||||||
$quarter_hour_expected = array(
|
$quarter_hour_expected = array(
|
||||||
'00:00:00', '00:15:00', '00:30:00', '00:45:00', '01:00:00',
|
'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(
|
$offset_start_time_interval = array_keys($this->date_time->getTimeInterval(
|
||||||
'03:00:00',
|
'03:00:00',
|
||||||
'+1 hour',
|
'+1 hour',
|
||||||
$total_steps=5
|
$total_steps = 5
|
||||||
));
|
));
|
||||||
$offset_start_time_expected = array(
|
$offset_start_time_expected = array(
|
||||||
'03:00:00', '04:00:00', '05:00:00', '06:00:00', '07:00:00',
|
'03:00:00', '04:00:00', '05:00:00', '06:00:00', '07:00:00',
|
||||||
|
Reference in New Issue
Block a user