Completed
Push — master ( 90a411...a748b4 )
by Simon
05:01
created

PartialSubmissionJobTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 5
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetTitle() 0 4 1
A testProcess() 0 4 1
A setUp() 0 8 1
1
<?php
2
3
namespace Firesphere\PartialUserforms\Tests;
4
5
use Firesphere\PartialUserforms\Jobs\PartialSubmissionJob;
6
use SilverStripe\Core\Config\Config;
7
use SilverStripe\Core\Injector\Injector;
8
use SilverStripe\Dev\SapphireTest;
9
use Symbiote\QueuedJobs\Services\QueuedJobService;
10
11
class PartialSubmissionJobTest extends SapphireTest
12
{
13
    /**
14
     * @var PartialSubmissionJob
15
     */
16
    protected $job;
17
18
    protected static $fixture_file = '../partialsubmissions.yml';
19
20
    public function testGetTitle()
21
    {
22
        $this->assertEquals('Export partial submissions to Email', $this->job->getTitle());
23
    }
24
25
    public function testProcess()
26
    {
27
        $this->assertTrue(method_exists($this->job, 'process'));
28
    }
29
30
    protected function setUp()
31
    {
32
        $this->usesDatabase = true;
33
        Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false);
34
        /** @var PartialSubmissionJob $job */
35
        $this->job = Injector::inst()->get(PartialSubmissionJob::class);
36
        return parent::setUp();
37
    }
38
}
39