22
22
final class VersionCheckCommandTest extends TestCase
23
23
{
24
24
/**
25
- * @return non-empty-list<array{0: non-empty-string, 1: positive- int, 2: non-empty-string, 3 : non-empty-string, 4 : non-empty-string}>
25
+ * @return non-empty-list<array{0: non-empty-string, 1: non-negative- int, 2: positive-int, 3: non-empty-string, 4 : non-empty-string, 5 : non-empty-string}>
26
26
*/
27
27
public static function provider (): array
28
28
{
29
29
return [
30
30
[
31
31
'You are using the latest version of PHPUnit. ' ,
32
+ Result::SUCCESS ,
32
33
10 ,
33
34
'10.5.0 ' ,
34
35
'10.5.0 ' ,
@@ -38,6 +39,7 @@ public static function provider(): array
38
39
'You are not using the latest version of PHPUnit.
39
40
The latest version compatible with PHPUnit 10.5.0 is PHPUnit 10.5.1.
40
41
The latest version is PHPUnit 10.5.1. ' ,
42
+ Result::FAILURE ,
41
43
10 ,
42
44
'10.5.0 ' ,
43
45
'10.5.1 ' ,
@@ -47,6 +49,7 @@ public static function provider(): array
47
49
'You are not using the latest version of PHPUnit.
48
50
The latest version compatible with PHPUnit 10.5.0 is PHPUnit 10.5.1.
49
51
The latest version is PHPUnit 11.0.0. ' ,
52
+ Result::FAILURE ,
50
53
10 ,
51
54
'10.5.0 ' ,
52
55
'11.0.0 ' ,
@@ -56,14 +59,15 @@ public static function provider(): array
56
59
}
57
60
58
61
/**
59
- * @param non-empty-string $expected
62
+ * @param non-empty-string $expectedMessage
63
+ * @param non-negative-int $expectedShellExitCode
60
64
* @param positive-int $majorVersionNumber
61
65
* @param non-empty-string $versionId
62
66
* @param non-empty-string $latestVersion
63
67
* @param non-empty-string $latestCompatibleVersion
64
68
*/
65
69
#[DataProvider('provider ' )]
66
- public function testChecksVersion (string $ expected , int $ majorVersionNumber , string $ versionId , string $ latestVersion , string $ latestCompatibleVersion ): void
70
+ public function testChecksVersion (string $ expectedMessage , int $ expectedShellExitCode , int $ majorVersionNumber , string $ versionId , string $ latestVersion , string $ latestCompatibleVersion ): void
67
71
{
68
72
$ command = new VersionCheckCommand (
69
73
$ this ->downloader ($ latestVersion , $ latestCompatibleVersion ),
@@ -73,7 +77,8 @@ public function testChecksVersion(string $expected, int $majorVersionNumber, str
73
77
74
78
$ result = $ command ->execute ();
75
79
76
- $ this ->assertSame ($ expected , trim ($ result ->output ()));
80
+ $ this ->assertSame ($ expectedMessage , trim ($ result ->output ()));
81
+ $ this ->assertSame ($ expectedShellExitCode , $ result ->shellExitCode ());
77
82
}
78
83
79
84
private function downloader (string $ latestVersion , string $ latestCompatibleVersion ): Downloader &Stub
0 commit comments