Completed
Pull Request — master (#37)
by
unknown
02:44
created

SecurityAlertCheckJobTest::testJobCallsTask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace BringYourOwnIdeas\SecurityChecker\Tests;
4
5
use BringYourOwnIdeas\SecurityChecker\Tasks\SecurityAlertCheckTask;
6
use BringYourOwnIdeas\SecurityChecker\Jobs\SecurityAlertCheckJob;
7
use SilverStripe\Dev\SapphireTest;
8
9
class SecurityAlertCheckJobTest extends SapphireTest
10
{
11
    public function testJobCallsTask()
12
    {
13
        $spy = $this->getMockBuilder(SecurityAlertCheckTask::class)->setMethods(['run'])->getMock();
14
        $spy->expects($this->once())->method('run');
15
16
        $job = new SecurityAlertCheckJob;
17
        $job->setCheckTask($spy);
18
19
        $job->process();
20
    }
21
}
22