parent
e957e5fe18
commit
0b21535f87
3 changed files with 20 additions and 12 deletions
|
@ -22,6 +22,8 @@
|
||||||
return [
|
return [
|
||||||
'defaultVendor' => [],
|
'defaultVendor' => [],
|
||||||
'customVendor' => [
|
'customVendor' => [
|
||||||
'runtime-set' => 'vendor MyCustomVendor',
|
'runtime-set' => [
|
||||||
|
'vendor' => 'MyCustomVendor',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
return [
|
return [
|
||||||
'defaultVendor' => [],
|
'defaultVendor' => [],
|
||||||
'customVendor' => [
|
'customVendor' => [
|
||||||
'runtime-set' => 'vendor MyCustomVendor',
|
'runtime-set' => [
|
||||||
|
'vendor' => 'MyCustomVendor',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -88,11 +88,12 @@ class SniffsTest extends TestCase
|
||||||
*/
|
*/
|
||||||
protected function executeSniff(SplFileInfo $folder, array $arguments = [])
|
protected function executeSniff(SplFileInfo $folder, array $arguments = [])
|
||||||
{
|
{
|
||||||
$internalArguments = array_merge([
|
$internalArguments = array_merge_recursive([
|
||||||
'runtime-set' => 'mappingFile '
|
'runtime-set' => [
|
||||||
. __DIR__ . DIRECTORY_SEPARATOR
|
'mappingFile' => __DIR__ . DIRECTORY_SEPARATOR
|
||||||
. 'Fixtures' . DIRECTORY_SEPARATOR
|
. 'Fixtures' . DIRECTORY_SEPARATOR
|
||||||
. 'LegacyClassnames.php',
|
. 'LegacyClassnames.php',
|
||||||
|
],
|
||||||
'report' => 'json',
|
'report' => 'json',
|
||||||
'sniffs' => $this->getSniffByFolder($folder),
|
'sniffs' => $this->getSniffByFolder($folder),
|
||||||
'inputFile' => $folder->getRealPath() . DIRECTORY_SEPARATOR . 'InputFileForIssues.php',
|
'inputFile' => $folder->getRealPath() . DIRECTORY_SEPARATOR . 'InputFileForIssues.php',
|
||||||
|
@ -217,12 +218,15 @@ class SniffsTest extends TestCase
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$prefix = "--$argumentName=";
|
if ($argumentName === 'runtime-set') {
|
||||||
if (in_array($argumentName, ['runtime-set'])) {
|
foreach ($argumentValue as $runtimeName => $runtimeValue) {
|
||||||
$prefix = "--$argumentName ";
|
$preparedArguments[] = "--$argumentName $runtimeName $runtimeValue";
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$preparedArguments[] = "$prefix$argumentValue";
|
$preparedArguments[] = "--$argumentName=$argumentValue";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $bin
|
return $bin
|
||||||
|
@ -249,7 +253,7 @@ class SniffsTest extends TestCase
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new \Exception(
|
throw new \Exception(
|
||||||
'Error during preparing json output by invoking '
|
'Error during preparing json output by invoking '
|
||||||
. $this->getPhpcsCall($arguments) . ' ' . $output,
|
. $this->getPhpcsCall($arguments) . ' ' . $e->getMessage(),
|
||||||
1491487079
|
1491487079
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue