parent
e957e5fe18
commit
0b21535f87
3 changed files with 20 additions and 12 deletions
|
@ -22,6 +22,8 @@
|
|||
return [
|
||||
'defaultVendor' => [],
|
||||
'customVendor' => [
|
||||
'runtime-set' => 'vendor MyCustomVendor',
|
||||
'runtime-set' => [
|
||||
'vendor' => 'MyCustomVendor',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
return [
|
||||
'defaultVendor' => [],
|
||||
'customVendor' => [
|
||||
'runtime-set' => 'vendor MyCustomVendor',
|
||||
'runtime-set' => [
|
||||
'vendor' => 'MyCustomVendor',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -88,11 +88,12 @@ class SniffsTest extends TestCase
|
|||
*/
|
||||
protected function executeSniff(SplFileInfo $folder, array $arguments = [])
|
||||
{
|
||||
$internalArguments = array_merge([
|
||||
'runtime-set' => 'mappingFile '
|
||||
. __DIR__ . DIRECTORY_SEPARATOR
|
||||
$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";
|
||||
}
|
||||
|
||||
$preparedArguments[] = "$prefix$argumentValue";
|
||||
continue;
|
||||
}
|
||||
|
||||
$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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue