Passed
Pull Request — master (#133)
by
unknown
02:18
created

StaticPublisherState   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A tearDownOnce() 0 2 1
A setUpOnce() 0 2 1
A tearDown() 0 5 1
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Dev;
4
5
use SilverStripe\Core\Config\Config;
6
use SilverStripe\Core\Injector\Injector;
7
use SilverStripe\Dev\SapphireTest;
8
use SilverStripe\Dev\State\TestState;
9
use SilverStripe\StaticPublishQueue\Test\QueuedJobsTestHandler;
10
use SilverStripe\StaticPublishQueue\Test\QueuedJobsTestService;
11
use Symbiote\QueuedJobs\Services\QueuedJobHandler;
12
use Symbiote\QueuedJobs\Services\QueuedJobService;
13
14
class StaticPublisherState implements TestState
15
{
16
    public function setUp(SapphireTest $test)
17
    {
18
        Injector::inst()->registerService(new QueuedJobsTestHandler(), QueuedJobHandler::class);
19
        Injector::inst()->registerService(new QueuedJobsTestService(), QueuedJobService::class);
20
        Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false);
21
    }
22
23
    public function tearDown(SapphireTest $test)
24
    {
25
        Injector::inst()->registerService(new QueuedJobsTestHandler(), QueuedJobHandler::class);
26
        Injector::inst()->registerService(new QueuedJobsTestService(), QueuedJobService::class);
27
        Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false);
28
    }
29
30
    public function setUpOnce($class)
31
    {
32
    }
33
34
    public function tearDownOnce($class)
35
    {
36
    }
37
}
38