Add public keyword to methods

[MAILPOET-2413]
This commit is contained in:
Amine Ben hammou
2019-12-26 12:56:49 +01:00
committed by wxa
parent ec409042d5
commit 43df66d162
823 changed files with 4440 additions and 4440 deletions

View File

@ -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);
}