1 | <?php |
||
23 | class Setup implements SetupInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected static $configTemplate = <<<EOF |
||
30 | suites: |
||
31 | unit: |
||
32 | path: . |
||
33 | {{tester}} |
||
34 | settings: |
||
35 | shuffle: true |
||
36 | paths: |
||
37 | tests: {{dir}} |
||
38 | output: {{dir}}/_output |
||
39 | support: {{dir}}/_support |
||
40 | data: {{dir}} |
||
41 | |||
42 | EOF; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | protected static $testerAndModules = <<<EOF |
||
48 | actor: UnitTester |
||
49 | modules: |
||
50 | enabled: |
||
51 | # add more modules here |
||
52 | - Asserts |
||
53 | EOF; |
||
54 | |||
55 | /** |
||
56 | * @var Module |
||
57 | */ |
||
58 | protected $module; |
||
59 | |||
60 | /** |
||
61 | * @var Filesystem |
||
62 | */ |
||
63 | protected $disk; |
||
64 | |||
65 | /** |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $workingDir; |
||
69 | |||
70 | /** |
||
71 | * SmartWebCodeceptionSetup constructor. |
||
72 | * |
||
73 | * @param Module|string $module |
||
74 | * @param string $disk |
||
75 | * |
||
76 | * @throws Exception |
||
77 | */ |
||
78 | public function __construct($module, string $disk = 'solution') |
||
83 | |||
84 | /** |
||
85 | * @return Filesystem |
||
86 | */ |
||
87 | public function getDisk() : Filesystem |
||
91 | |||
92 | /** |
||
93 | * Get the path relative to the working directory of this Setup. |
||
94 | * |
||
95 | * @param string $path |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function getPath(string $path) : string |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getWorkDir() : string |
||
111 | |||
112 | /** |
||
113 | * @inheritDoc |
||
114 | */ |
||
115 | public function getTestsDir() : string |
||
119 | |||
120 | /** |
||
121 | * @return string |
||
122 | */ |
||
123 | protected function resolveWorkDir() : string |
||
127 | |||
128 | /** |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getNamespace() : string |
||
141 | |||
142 | /** |
||
143 | * @param string $path |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | protected function getPathRelativeToBasePath(string $path) : string |
||
151 | |||
152 | /** |
||
153 | * @return Module |
||
154 | */ |
||
155 | public function getModule() : Module |
||
159 | |||
160 | /** |
||
161 | * @param Module|string $module |
||
162 | * |
||
163 | * @return Module |
||
164 | * @throws Exception |
||
165 | */ |
||
166 | private function resolveModule($module) : Module |
||
179 | |||
180 | } |
||
181 |