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

StaticPublisherState::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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