|
4 | 4 |
|
5 | 5 | use Laravel\Boost\Console\InstallCommand;
|
6 | 6 |
|
7 |
| -test('isRunningInWsl returns true when WSL_DISTRO_NAME is set', function () { |
| 7 | +test('isRunningInWsl returns true when WSL_DISTRO_NAME is set', function (): void { |
8 | 8 | putenv('WSL_DISTRO_NAME=Ubuntu');
|
9 | 9 |
|
10 |
| - $command = new InstallCommand(); |
| 10 | + $command = new InstallCommand; |
11 | 11 | $reflection = new ReflectionClass($command);
|
12 | 12 | $method = $reflection->getMethod('isRunningInWsl');
|
13 |
| - $method->setAccessible(true); |
14 | 13 |
|
15 | 14 | expect($method->invoke($command))->toBeTrue();
|
16 | 15 | });
|
17 | 16 |
|
18 |
| -test('isRunningInWsl returns true when IS_WSL is set', function () { |
| 17 | +test('isRunningInWsl returns true when IS_WSL is set', function (): void { |
19 | 18 | putenv('IS_WSL=1');
|
20 | 19 |
|
21 |
| - $command = new InstallCommand(); |
| 20 | + $command = new InstallCommand; |
22 | 21 | $reflection = new ReflectionClass($command);
|
23 | 22 | $method = $reflection->getMethod('isRunningInWsl');
|
24 |
| - $method->setAccessible(true); |
25 | 23 |
|
26 | 24 | expect($method->invoke($command))->toBeTrue();
|
27 | 25 | });
|
28 | 26 |
|
29 |
| -test('isRunningInWsl returns true when both WSL env vars are set', function () { |
| 27 | +test('isRunningInWsl returns true when both WSL env vars are set', function (): void { |
30 | 28 | putenv('WSL_DISTRO_NAME=Ubuntu');
|
31 | 29 | putenv('IS_WSL=true');
|
32 | 30 |
|
33 |
| - $command = new InstallCommand(); |
| 31 | + $command = new InstallCommand; |
34 | 32 | $reflection = new ReflectionClass($command);
|
35 | 33 | $method = $reflection->getMethod('isRunningInWsl');
|
36 |
| - $method->setAccessible(true); |
37 | 34 |
|
38 | 35 | expect($method->invoke($command))->toBeTrue();
|
39 | 36 | });
|
40 | 37 |
|
41 |
| -test('isRunningInWsl returns false when no WSL env vars are set', function () { |
| 38 | +test('isRunningInWsl returns false when no WSL env vars are set', function (): void { |
42 | 39 | putenv('WSL_DISTRO_NAME');
|
43 | 40 | putenv('IS_WSL');
|
44 | 41 |
|
45 |
| - $command = new InstallCommand(); |
| 42 | + $command = new InstallCommand; |
46 | 43 | $reflection = new ReflectionClass($command);
|
47 | 44 | $method = $reflection->getMethod('isRunningInWsl');
|
48 |
| - $method->setAccessible(true); |
49 | 45 |
|
50 | 46 | expect($method->invoke($command))->toBeFalse();
|
51 | 47 | });
|
52 | 48 |
|
53 |
| -test('isRunningInWsl returns false when WSL env vars are empty strings', function () { |
| 49 | +test('isRunningInWsl returns false when WSL env vars are empty strings', function (): void { |
54 | 50 | putenv('WSL_DISTRO_NAME=');
|
55 | 51 | putenv('IS_WSL=');
|
56 | 52 |
|
57 |
| - $command = new InstallCommand(); |
| 53 | + $command = new InstallCommand; |
58 | 54 | $reflection = new ReflectionClass($command);
|
59 | 55 | $method = $reflection->getMethod('isRunningInWsl');
|
60 |
| - $method->setAccessible(true); |
61 | 56 |
|
62 | 57 | expect($method->invoke($command))->toBeFalse();
|
63 | 58 | });
|
0 commit comments