tearDownAfterClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\MockServer\Testing;
4
5
use EdmondsCommerce\MockServer\Factory;
6
use EdmondsCommerce\MockServer\MockServer;
7
8
/**
9
 * Trait SetupsUpMockServerBeforeClassTrait
10
 *
11
 * @package EdmondsCommerce\MockServer\Testing
12
 * @SuppressWarnings(PHPMD.StaticAccess)
13
 */
14
trait SetsUpMockServerBeforeClassTrait
15
{
16
17
    /**
18
     * @var MockServer
19
     */
20
    protected static $mockServer;
21
22
    /**
23
     * @throws \Exception
24
     */
25
    public static function setupBeforeClass()
26
    {
27
        static::setupMockServer();
28
    }
29
30
    public static function tearDownAfterClass()
31
    {
32
        static::tearDownMockServer();
33
    }
34
35
    /**
36
     * @throws \Exception
37
     */
38
    protected static function setupMockServer()
39
    {
40
        static::$mockServer = Factory::getMockServer();
41
        static::$mockServer->startServer(false);
42
    }
43
44
    protected static function tearDownMockServer()
45
    {
46
        static::$mockServer->stopServer();
47
    }
48
}
49