Completed
Push — master ( 60e303...4c478a )
by
unknown
8s
created

tests/Tasks/CleanupGeneratedPdfDailyTaskTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace CWP\PDFExport\Tests\Tasks;
4
5
use CWP\PDFExport\Tasks\CleanupGeneratedPdfDailyTask;
6
use SilverStripe\Core\Config\Config;
7
use SilverStripe\CronTask\Interfaces\CronTask;
0 ignored issues
show
The type SilverStripe\CronTask\Interfaces\CronTask was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use SilverStripe\Dev\SapphireTest;
9
10
class CleanupGeneratedPdfDailyTaskTest extends SapphireTest
11
{
12
    /**
13
     * @var CleanupGeneratedPdfDailyTask
14
     */
15
    protected $task;
16
17
    protected function setUp()
18
    {
19
        parent::setUp();
20
21
        if (!interface_exists(CronTask::class)) {
22
            $this->markTestSkipped('Test class requires the silverstripe/crontask module to be installed');
23
        }
24
25
        $this->task = new CleanupGeneratedPdfDailyTask();
26
    }
27
28
    public function testCronScheduleIsConfigurable()
29
    {
30
        Config::modify()->set(CleanupGeneratedPdfDailyTask::class, 'schedule', '* 1 2 3 *');
31
32
        $this->assertSame('* 1 2 3 *', $this->task->getSchedule());
33
    }
34
}
35