TestHelper   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 17
dl 0
loc 44
rs 10
c 1
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getTempPath() 0 2 1
A setSkipAccountModificationTests() 0 2 1
A setSkipOrderModificationTests() 0 2 1
A __construct() 0 9 2
A shouldSkipAccountModificationTests() 0 2 1
A getNonExistingPath() 0 2 1
A shouldSkipOrderModificationTests() 0 2 1
1
<?php
2
namespace LE_ACME2Tests;
3
4
use LE_ACME2\SingletonTrait;
5
6
class TestHelper {
7
8
    private $_tempPath;
9
    private $_nonExistingPath;
10
11
    use SingletonTrait;
12
13
    private function __construct() {
14
15
        $projectPath = realpath($_SERVER[ 'PWD' ]) . '/';
16
        $this->_tempPath = $projectPath . 'temp/';
17
        if( !file_exists($this->_tempPath) ) {
18
            mkdir($this->_tempPath);
19
        }
20
21
        $this->_nonExistingPath = $this->getTempPath() . 'should-not-exist/';
22
    }
23
24
    public function getTempPath() : string {
25
        return $this->_tempPath;
26
    }
27
28
    public function getNonExistingPath() : string {
29
        return $this->_nonExistingPath;
30
    }
31
32
    private $_skipAccountModificationTests = false;
33
34
    public function setSkipAccountModificationTests(bool $value) : void {
35
        $this->_skipAccountModificationTests = $value;
36
    }
37
    
38
    public function shouldSkipAccountModificationTests() : bool {
39
        return $this->_skipAccountModificationTests;
40
    }
41
42
    private $_skipOrderModificationTests = false;
43
44
    public function setSkipOrderModificationTests(bool $value) : void {
45
        $this->_skipOrderModificationTests = $value;
46
    }
47
48
    public function shouldSkipOrderModificationTests() : bool {
49
        return $this->_skipOrderModificationTests;
50
    }
51
}