1 | <?php |
||
23 | class Setup implements SetupInterface |
||
24 | { |
||
25 | |||
26 | const TEST_NAMESPACE = 'App\\Administration\\%s\\' . self::DEFAULT_TESTS_DIR; |
||
27 | |||
28 | const WORKING_DIR = 'app/Administration/%s'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected static $configTemplate = <<<EOF |
||
34 | suites: |
||
35 | unit: |
||
36 | path: . |
||
37 | {{tester}} |
||
38 | settings: |
||
39 | shuffle: true |
||
40 | paths: |
||
41 | tests: {{dir}} |
||
42 | output: {{dir}}/_output |
||
43 | support: {{dir}}/_support |
||
44 | data: {{dir}} |
||
45 | |||
46 | EOF; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected static $testerAndModules = <<<EOF |
||
52 | actor: UnitTester |
||
53 | modules: |
||
54 | enabled: |
||
55 | # add more modules here |
||
56 | - Asserts |
||
57 | EOF; |
||
58 | |||
59 | /** |
||
60 | * @var Module |
||
61 | */ |
||
62 | protected $module; |
||
63 | |||
64 | /** |
||
65 | * @var Filesystem |
||
66 | */ |
||
67 | protected $disk; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $workingDir; |
||
73 | |||
74 | /** |
||
75 | * SmartWebCodeceptionSetup constructor. |
||
76 | * |
||
77 | * @param Module|string $module |
||
78 | * @param string $disk |
||
79 | * |
||
80 | * @throws Exception |
||
81 | */ |
||
82 | public function __construct($module, string $disk = 'solution') |
||
87 | |||
88 | /** |
||
89 | * @return Filesystem |
||
90 | */ |
||
91 | public function getDisk() : Filesystem |
||
95 | |||
96 | /** |
||
97 | * Get the path relative to the working directory of this Setup. |
||
98 | * |
||
99 | * @param string $path |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getPath(string $path) : string |
||
107 | |||
108 | /** |
||
109 | * @return string |
||
110 | */ |
||
111 | public function getWorkDir() : string |
||
115 | |||
116 | /** |
||
117 | * @inheritDoc |
||
118 | */ |
||
119 | public function getTestsDir() : string |
||
123 | |||
124 | /** |
||
125 | * @return string |
||
126 | */ |
||
127 | protected function resolveWorkDir() : string |
||
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getNamespace() : string |
||
145 | |||
146 | /** |
||
147 | * @param string $path |
||
148 | * |
||
149 | * @return string |
||
150 | */ |
||
151 | protected function getPathRelativeToBasePath(string $path) : string |
||
155 | |||
156 | /** |
||
157 | * @return Module |
||
158 | */ |
||
159 | protected function getModule() : Module |
||
163 | |||
164 | /** |
||
165 | * @param Module|string $module |
||
166 | * |
||
167 | * @return Module |
||
168 | * @throws Exception |
||
169 | */ |
||
170 | private function resolveModule($module) : Module |
||
183 | |||
184 | } |