-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from bestit/feature/mutiple-configs
Added support for multiple config files.
- Loading branch information
Showing
6 changed files
with
73 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* @author best it AG <[email protected]> | ||
* @package BestIt\LicenseCheck\Command | ||
*/ | ||
class CommandExceptionTest extends TestCase | ||
class LicenseCheckCommandTest extends TestCase | ||
{ | ||
/** | ||
* The test fixture. | ||
|
@@ -55,15 +55,15 @@ public function getExecutionDataProvider(): array | |
[], | ||
0, | ||
getcwd(), | ||
getcwd() . '/license-check.yml', | ||
[getcwd() . '/license-check.yml'], | ||
[], | ||
], | ||
// Actual working directory. Errors not ignores. No custom config. Result has violations. | ||
[ | ||
[], | ||
1, | ||
getcwd(), | ||
getcwd() . '/license-check.yml', | ||
[getcwd() . '/license-check.yml'], | ||
['VIOLATION'], | ||
], | ||
// Actual working directory. Errors are ignores. No custom config. Result has violations. | ||
|
@@ -73,7 +73,7 @@ public function getExecutionDataProvider(): array | |
], | ||
0, | ||
getcwd(), | ||
getcwd() . '/license-check.yml', | ||
[getcwd() . '/license-check.yml'], | ||
['VIOLATION'], | ||
], | ||
// Custom working directory. Errors not ignores. No custom config. Result has no violations. | ||
|
@@ -83,7 +83,7 @@ public function getExecutionDataProvider(): array | |
], | ||
0, | ||
'/test-directory', | ||
'/test-directory/license-check.yml', | ||
['/test-directory/license-check.yml'], | ||
[], | ||
], | ||
// Custom working directory. Errors not ignores. No custom config. Result has violations. | ||
|
@@ -93,7 +93,7 @@ public function getExecutionDataProvider(): array | |
], | ||
1, | ||
'/test-directory', | ||
'/test-directory/license-check.yml', | ||
['/test-directory/license-check.yml'], | ||
['VIOLATION'], | ||
], | ||
// Custom working directory. Errors are ignores. No custom config. Result has violations. | ||
|
@@ -104,41 +104,41 @@ public function getExecutionDataProvider(): array | |
], | ||
0, | ||
'/test-directory', | ||
'/test-directory/license-check.yml', | ||
['/test-directory/license-check.yml'], | ||
['VIOLATION'], | ||
], | ||
// Custom working directory. Errors not ignores. Custom config. Result has no violations. | ||
[ | ||
[ | ||
'directory' => '/test-directory', | ||
'--configuration' => '/testconfig.yml', | ||
'--configuration' => ['/testconfig.yml'], | ||
], | ||
0, | ||
'/test-directory', | ||
'/testconfig.yml', | ||
['/testconfig.yml'], | ||
[], | ||
], | ||
// Custom working directory. Errors not ignores. No custom config. Result has violations. | ||
[ | ||
[ | ||
'directory' => '/test-directory', | ||
'--configuration' => '/testconfig.yml', | ||
'--configuration' => ['/testconfig.yml'], | ||
], | ||
1, | ||
'/test-directory', | ||
'/testconfig.yml', | ||
['/testconfig.yml'], | ||
['VIOLATION'], | ||
], | ||
// Custom working directory. Errors are ignores. No custom config. Result has violations. | ||
[ | ||
[ | ||
'directory' => '/test-directory', | ||
'--ignore-errors' => true, | ||
'--configuration' => '/testconfig.yml', | ||
'--configuration' => ['/testconfig.yml'], | ||
], | ||
0, | ||
'/test-directory', | ||
'/testconfig.yml', | ||
['/testconfig.yml'], | ||
['VIOLATION'], | ||
], | ||
]; | ||
|
@@ -171,6 +171,7 @@ public function testDefinition(): void | |
|
||
self::assertTrue($this->fixture->getDefinition()->hasOption('configuration')); | ||
self::assertTrue($this->fixture->getDefinition()->getOption('configuration')->isValueRequired()); | ||
self::assertTrue($this->fixture->getDefinition()->getOption('configuration')->isArray()); | ||
|
||
self::assertTrue($this->fixture->getDefinition()->hasOption('ignore-errors')); | ||
self::assertFalse($this->fixture->getDefinition()->getOption('ignore-errors')->isValueOptional()); | ||
|
@@ -185,7 +186,7 @@ public function testDefinition(): void | |
* @param string[] $input | ||
* @param int $resultCode | ||
* @param string $directory | ||
* @param string $configPath | ||
* @param array $configFiles | ||
* @param string[] $violations | ||
* | ||
* @return void | ||
|
@@ -194,13 +195,13 @@ public function testExecution( | |
array $input, | ||
int $resultCode, | ||
string $directory, | ||
string $configPath, | ||
array $configFiles, | ||
array $violations, | ||
): void { | ||
$this | ||
->configurationLoader | ||
->method('load') | ||
->with($configPath) | ||
->with($configFiles) | ||
->willReturn($configuration = $this->createMock(Configuration::class)); | ||
|
||
$resultSet = new Result(); | ||
|