@@ -167,6 +167,10 @@ |
||
167 | 167 | $this->assertFileEquals($dataDir.'/expected.' . $fileType, $workingDir.'/'.$testCase['config']['file'], $testCase['title']); |
168 | 168 | } |
169 | 169 | |
170 | + /** |
|
171 | + * @param string $dataDir |
|
172 | + * @param string $workingDir |
|
173 | + */ |
|
170 | 174 | private function initializeTestCase(array $testCase, $dataDir, $workingDir, $fileType) |
171 | 175 | { |
172 | 176 | $fs = new Filesystem(); |
@@ -138,23 +138,23 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function testParameterHandling($testCaseName, $fileType) |
140 | 140 | { |
141 | - $dataDir = __DIR__.'/fixtures/testcases/'. $fileType . '/' .$testCaseName; |
|
141 | + $dataDir = __DIR__.'/fixtures/testcases/'.$fileType.'/'.$testCaseName; |
|
142 | 142 | |
143 | 143 | $testCase = array_replace_recursive( |
144 | 144 | array( |
145 | 145 | 'title' => 'unknown test', |
146 | 146 | 'config' => array( |
147 | - 'file' => 'parameters.' . $fileType, |
|
147 | + 'file' => 'parameters.'.$fileType, |
|
148 | 148 | 'file-type' => $fileType, |
149 | 149 | ), |
150 | - 'dist-file' => 'parameters.'. $fileType .'.dist', |
|
150 | + 'dist-file' => 'parameters.'.$fileType.'.dist', |
|
151 | 151 | 'environment' => array(), |
152 | 152 | 'interactive' => false, |
153 | 153 | ), |
154 | 154 | (array) Yaml::parse(file_get_contents($dataDir.'/setup.yml')) |
155 | 155 | ); |
156 | 156 | |
157 | - $workingDir = sys_get_temp_dir() . '/incenteev_parameter_handler'; |
|
157 | + $workingDir = sys_get_temp_dir().'/incenteev_parameter_handler'; |
|
158 | 158 | $exists = $this->initializeTestCase($testCase, $dataDir, $workingDir, $fileType); |
159 | 159 | |
160 | 160 | $message = sprintf('<info>%s the "%s" file</info>', $exists ? 'Updating' : 'Creating', $testCase['config']['file']); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | $this->processor->processFile($testCase['config']); |
166 | 166 | |
167 | - $this->assertFileEquals($dataDir.'/expected.' . $fileType, $workingDir.'/'.$testCase['config']['file'], $testCase['title']); |
|
167 | + $this->assertFileEquals($dataDir.'/expected.'.$fileType, $workingDir.'/'.$testCase['config']['file'], $testCase['title']); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | private function initializeTestCase(array $testCase, $dataDir, $workingDir, $fileType) |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | $fs->remove($workingDir); |
176 | 176 | } |
177 | 177 | |
178 | - $fs->copy($dataDir.'/dist.' . $fileType, $workingDir.'/'. $testCase['dist-file']); |
|
178 | + $fs->copy($dataDir.'/dist.'.$fileType, $workingDir.'/'.$testCase['dist-file']); |
|
179 | 179 | |
180 | - if ($exists = file_exists($dataDir.'/existing.' . $fileType)) { |
|
181 | - $fs->copy($dataDir.'/existing.' . $fileType, $workingDir.'/'.$testCase['config']['file']); |
|
180 | + if ($exists = file_exists($dataDir.'/existing.'.$fileType)) { |
|
181 | + $fs->copy($dataDir.'/existing.'.$fileType, $workingDir.'/'.$testCase['config']['file']); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | foreach ($testCase['environment'] as $var => $value) { |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function save($filePath, $data) |
22 | 22 | { |
23 | - return file_put_contents($filePath, "# This file is auto-generated during the composer install\n" . Yaml::dump($data, 99)); |
|
23 | + return file_put_contents($filePath, "# This file is auto-generated during the composer install\n".Yaml::dump($data, 99)); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -20,10 +20,10 @@ |
||
20 | 20 | public static function createFileHandler($fileType) |
21 | 21 | { |
22 | 22 | if (!isset(self::$handlers[$fileType])) { |
23 | - throw new \RuntimeException('Unsupported file type: ' . $fileType); |
|
23 | + throw new \RuntimeException('Unsupported file type: '.$fileType); |
|
24 | 24 | } |
25 | 25 | |
26 | - $className = '\\Incenteev\\ParameterHandler\\FileHandler\\' . self::$handlers[$fileType]; |
|
26 | + $className = '\\Incenteev\\ParameterHandler\\FileHandler\\'.self::$handlers[$fileType]; |
|
27 | 27 | |
28 | 28 | return new $className(); |
29 | 29 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | if (empty($config['dist-file'])) { |
81 | - $config['dist-file'] = $config['file'] . '.dist'; |
|
81 | + $config['dist-file'] = $config['file'].'.dist'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | if (!is_file($config['dist-file'])) { |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | 3 | return array ( |
4 | - 'parameters' => |
|
5 | - array ( |
|
4 | + 'parameters' => |
|
5 | + array ( |
|
6 | 6 | 'foo' => 'bar', |
7 | 7 | 'boolean' => false, |
8 | - ), |
|
8 | + ), |
|
9 | 9 | ); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'parameters' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 'foo' => 'bar', |
7 | 7 | 'boolean' => false, |
8 | 8 | ), |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | 3 | return array ( |
4 | - 'parameters' => |
|
5 | - array ( |
|
4 | + 'parameters' => |
|
5 | + array ( |
|
6 | 6 | 'foo' => 'bar', |
7 | 7 | 'boolean' => false, |
8 | - ), |
|
8 | + ), |
|
9 | 9 | ); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'parameters' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 'foo' => 'bar', |
7 | 7 | 'boolean' => false, |
8 | 8 | ), |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | 3 | return array ( |
4 | - 'parameters' => |
|
5 | - array ( |
|
4 | + 'parameters' => |
|
5 | + array ( |
|
6 | 6 | 'foo' => 'existing_foo', |
7 | 7 | 'boolean' => false, |
8 | 8 | 'another' => NULL, |
9 | 9 | 'nested' => |
10 | 10 | array ( |
11 | - 'foo' => 'bar', |
|
12 | - 'bar' => 'baz', |
|
11 | + 'foo' => 'bar', |
|
12 | + 'bar' => 'baz', |
|
13 | + ), |
|
13 | 14 | ), |
14 | - ), |
|
15 | 15 | ); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'parameters' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 'foo' => 'existing_foo', |
7 | 7 | 'boolean' => false, |
8 | 8 | 'another' => NULL, |
9 | 9 | 'nested' => |
10 | - array ( |
|
10 | + array( |
|
11 | 11 | 'foo' => 'bar', |
12 | 12 | 'bar' => 'baz', |
13 | 13 | ), |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | 3 | return array ( |
4 | - 'parameters' => |
|
5 | - array ( |
|
4 | + 'parameters' => |
|
5 | + array ( |
|
6 | 6 | 'foo' => 'bar', |
7 | - ), |
|
7 | + ), |
|
8 | 8 | ); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // This file is auto-generated during the composer install |
3 | -return array ( |
|
3 | +return array( |
|
4 | 4 | 'parameters' => |
5 | - array ( |
|
5 | + array( |
|
6 | 6 | 'foo' => 'bar', |
7 | 7 | ), |
8 | 8 | ); |