diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff/Arguments.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff/Arguments.php index e4121c8..de034c3 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff/Arguments.php +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingNamespaceSniff/Arguments.php @@ -22,6 +22,8 @@ return [ 'defaultVendor' => [], 'customVendor' => [ - 'runtime-set' => 'vendor MyCustomVendor', + 'runtime-set' => [ + 'vendor' => 'MyCustomVendor', + ], ], ]; diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingVendorForPluginsAndModulesSniff/Arguments.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingVendorForPluginsAndModulesSniff/Arguments.php index e4121c8..de034c3 100644 --- a/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingVendorForPluginsAndModulesSniff/Arguments.php +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/LegacyClassnames/MissingVendorForPluginsAndModulesSniff/Arguments.php @@ -22,6 +22,8 @@ return [ 'defaultVendor' => [], 'customVendor' => [ - 'runtime-set' => 'vendor MyCustomVendor', + 'runtime-set' => [ + 'vendor' => 'MyCustomVendor', + ], ], ]; diff --git a/tests/SniffsTest.php b/tests/SniffsTest.php index 994c398..ad2dd10 100644 --- a/tests/SniffsTest.php +++ b/tests/SniffsTest.php @@ -88,11 +88,12 @@ class SniffsTest extends TestCase */ protected function executeSniff(SplFileInfo $folder, array $arguments = []) { - $internalArguments = array_merge([ - 'runtime-set' => 'mappingFile ' - . __DIR__ . DIRECTORY_SEPARATOR - . 'Fixtures' . DIRECTORY_SEPARATOR - . 'LegacyClassnames.php', + $internalArguments = array_merge_recursive([ + 'runtime-set' => [ + 'mappingFile' => __DIR__ . DIRECTORY_SEPARATOR + . 'Fixtures' . DIRECTORY_SEPARATOR + . 'LegacyClassnames.php', + ], 'report' => 'json', 'sniffs' => $this->getSniffByFolder($folder), 'inputFile' => $folder->getRealPath() . DIRECTORY_SEPARATOR . 'InputFileForIssues.php', @@ -217,12 +218,15 @@ class SniffsTest extends TestCase continue; } - $prefix = "--$argumentName="; - if (in_array($argumentName, ['runtime-set'])) { - $prefix = "--$argumentName "; + if ($argumentName === 'runtime-set') { + foreach ($argumentValue as $runtimeName => $runtimeValue) { + $preparedArguments[] = "--$argumentName $runtimeName $runtimeValue"; + } + + continue; } - $preparedArguments[] = "$prefix$argumentValue"; + $preparedArguments[] = "--$argumentName=$argumentValue"; } return $bin @@ -249,7 +253,7 @@ class SniffsTest extends TestCase } catch (\Exception $e) { throw new \Exception( 'Error during preparing json output by invoking ' - . $this->getPhpcsCall($arguments) . ' ' . $output, + . $this->getPhpcsCall($arguments) . ' ' . $e->getMessage(), 1491487079 ); }