Passed
Push — master ( b6f9c0...18138a )
by Robbie
02:20
created

SecurityAlertCheckJobTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace BringYourOwnIdeas\SecurityChecker\Tests;
4
5
use BringYourOwnIdeas\SecurityChecker\Jobs\SecurityAlertCheckJob;
6
use BringYourOwnIdeas\SecurityChecker\Tasks\SecurityAlertCheckTask;
7
use SilverStripe\Dev\SapphireTest;
8
use Symbiote\QueuedJobs\Services\QueuedJobService;
9
10
class SecurityAlertCheckJobTest extends SapphireTest
11
{
12
    protected function setUp()
13
    {
14
        parent::setUp();
15
16
        QueuedJobService::config()->set('use_shutdown_function', false);
17
    }
18
19
    public function testJobCallsTask()
20
    {
21
        $spy = $this->getMockBuilder(SecurityAlertCheckTask::class)->setMethods(['run'])->getMock();
22
        $spy->expects($this->once())->method('run');
23
24
        $job = new SecurityAlertCheckJob;
25
        $job->setCheckTask($spy);
26
27
        $job->process();
28
    }
29
}
30