|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of CaptainHook |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Sebastian Feldmann <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace CaptainHook\App\Hook\Message\Rule; |
|
13
|
|
|
|
|
14
|
|
|
use PHPUnit\Framework\Attributes\DataProvider; |
|
|
|
|
|
|
15
|
|
|
use SebastianFeldmann\Git\CommitMessage; |
|
16
|
|
|
use PHPUnit\Framework\TestCase; |
|
17
|
|
|
|
|
18
|
|
|
class UseImperativeMoodTest extends TestCase |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* @param string $string |
|
22
|
|
|
* @param bool $begin |
|
23
|
|
|
* @param bool $expectedResult |
|
24
|
|
|
*/ |
|
25
|
|
|
#[DataProvider('passProvider')] |
|
26
|
|
|
public function testPass(string $string, bool $begin, bool $expectedResult): void |
|
27
|
|
|
{ |
|
28
|
|
|
$msg = new CommitMessage($string); |
|
29
|
|
|
$rule = new UseImperativeMood($begin); |
|
30
|
|
|
$this->assertSame($expectedResult, $rule->pass($msg)); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public static function passProvider(): array |
|
34
|
|
|
{ |
|
35
|
|
|
return [ |
|
36
|
|
|
['foo bar baz', true, true], |
|
37
|
|
|
['foo bar baz', false, true], |
|
38
|
|
|
['fixed soemthing something', false, false], |
|
39
|
|
|
['fixed soemthing something', true, false], |
|
40
|
|
|
['soemthing fixed something', false, false], |
|
41
|
|
|
['soemthing fixed something', true, true], |
|
42
|
|
|
]; |
|
43
|
|
|
} |
|
44
|
|
|
} |
|
45
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths