Add public keyword to methods
[MAILPOET-2413]
This commit is contained in:
@ -14,13 +14,13 @@ use MailPoetVendor\Idiorm\ORM;
|
||||
require_once __DIR__ . '/SimpleWorkerMockImplementation.php';
|
||||
|
||||
class SimpleWorkerTest extends \MailPoetTest {
|
||||
function _before() {
|
||||
public function _before() {
|
||||
parent::_before();
|
||||
$this->cron_helper = ContainerWrapper::getInstance()->get(CronHelper::class);
|
||||
$this->worker = new MockSimpleWorker();
|
||||
}
|
||||
|
||||
function testItRequiresTaskTypeToConstruct() {
|
||||
public function testItRequiresTaskTypeToConstruct() {
|
||||
$worker = Stub::make(
|
||||
'MailPoet\Cron\Workers\SimpleWorker',
|
||||
[],
|
||||
@ -35,13 +35,13 @@ class SimpleWorkerTest extends \MailPoetTest {
|
||||
}
|
||||
}
|
||||
|
||||
function testItSchedulesTask() {
|
||||
public function testItSchedulesTask() {
|
||||
expect(ScheduledTask::where('type', MockSimpleWorker::TASK_TYPE)->findMany())->isEmpty();
|
||||
(new MockSimpleWorker())->schedule();
|
||||
expect(ScheduledTask::where('type', MockSimpleWorker::TASK_TYPE)->findMany())->notEmpty();
|
||||
}
|
||||
|
||||
function testItDoesNotScheduleTaskTwice() {
|
||||
public function testItDoesNotScheduleTaskTwice() {
|
||||
$worker = new MockSimpleWorker();
|
||||
expect(count(ScheduledTask::where('type', MockSimpleWorker::TASK_TYPE)->findMany()))->equals(0);
|
||||
$worker->schedule();
|
||||
@ -50,7 +50,7 @@ class SimpleWorkerTest extends \MailPoetTest {
|
||||
expect(count(ScheduledTask::where('type', MockSimpleWorker::TASK_TYPE)->findMany()))->equals(1);
|
||||
}
|
||||
|
||||
function testItCalculatesNextRunDateWithinNextWeekBoundaries() {
|
||||
public function testItCalculatesNextRunDateWithinNextWeekBoundaries() {
|
||||
$current_date = Carbon::createFromTimestamp(current_time('timestamp'));
|
||||
$next_run_date = (new MockSimpleWorker())->getNextRunDate();
|
||||
$difference = $next_run_date->diffInDays($current_date);
|
||||
@ -60,7 +60,7 @@ class SimpleWorkerTest extends \MailPoetTest {
|
||||
expect($difference)->greaterOrEquals(0);
|
||||
}
|
||||
|
||||
function _after() {
|
||||
public function _after() {
|
||||
$this->di_container->get(SettingsRepository::class)->truncate();
|
||||
ORM::raw_execute('TRUNCATE ' . ScheduledTask::$_table);
|
||||
}
|
||||
|
Reference in New Issue
Block a user