Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase test coverage for --sniffs and --exclude options #474

Merged
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6bba777
Increase test coverage for --sniffs and --exclude
fredden Apr 28, 2024
46f27de
Merge remote-tracking branch 'upstream/master' into feature/tests/con…
fredden May 5, 2024
2829da7
Fix tyop
fredden May 5, 2024
61c7bf9
Use capital letters in comments
fredden May 5, 2024
c73d0b3
Quote fixed strings to avoid confustion with words
fredden May 5, 2024
8e2603f
Add full-stops
fredden May 5, 2024
3391c09
Rename variable
fredden May 5, 2024
f14581f
Sort 'use' statements
fredden May 5, 2024
7ee42d1
Unwrap foreach; reduce test cases
fredden May 5, 2024
13edab3
Name tests
fredden May 5, 2024
bd314c1
Test an empty string
fredden May 5, 2024
1ffe83a
Rename testscase
fredden May 5, 2024
db76be8
Add another test case
fredden May 6, 2024
389f112
Correct indentation
fredden May 6, 2024
bd249fb
Mark test as not-risky
fredden May 6, 2024
e92830d
Use more specific return type shape in comment
fredden May 6, 2024
b6df259
Assert configuration value is set on success
fredden May 6, 2024
b18272d
Add test case for setting multiple times
fredden May 6, 2024
6400c61
Rename class again
fredden May 8, 2024
35d8a65
Clarify shape of return array
fredden May 13, 2024
f7aa3ef
Clarify shape of return array
fredden May 13, 2024
fd5b8c7
Clarify shape of return array
fredden May 13, 2024
801aefa
Correct comment
fredden May 13, 2024
81bea03
Set 'position' argument
fredden May 13, 2024
9d964ee
Avoid using internal method
fredden May 14, 2024
a0b31d9
Mark internal method as internal
fredden May 14, 2024
70358b0
Revert "Mark internal method as internal"
fredden May 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test case for setting multiple times
fredden committed May 6, 2024

Verified

This commit was signed with the committer’s verified signature.
fpapon François Papon
commit b18272d9a6a71bd3fa7caeaf6034422e31d110ea
35 changes: 35 additions & 0 deletions tests/Core/Config/SniffListValidationTest.php
Original file line number Diff line number Diff line change
@@ -161,4 +161,39 @@ public static function dataValidSniffs()
}//end dataValidSniffs()


/**
* Ensure that only the first argument is processed and others are ignored.
*
* @param string $argument 'sniffs' or 'exclude'.
*
* @return void
* @dataProvider dataOnlySetOnce
*/
public function testOnlySetOnce($argument)
{
$config = new ConfigDouble();
$config->processLongArgument($argument.'=StandardOne.Category.Sniff', 0);
$config->processLongArgument($argument.'=StandardTwo.Category.Sniff', 0);
$config->processLongArgument($argument.'=Standard.AnotherCategory.Sniff', 0);

$this->assertSame(['StandardOne.Category.Sniff'], $config->$argument);

}//end testOnlySetOnce()


/**
* Data provider for testOnlySetOnce().
*
* @return string[]
*/
public static function dataOnlySetOnce()
{
return [
'sniffs' => ['sniffs'],
'exclude' => ['exclude'],
];

}//end dataOnlySetOnce()


}//end class