Skip to content

Commit c07380e

Browse files
committed
rector: update test return types
1 parent 854b516 commit c07380e

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

tests/Feature/Console/InstallCommandWslTest.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,55 @@
44

55
use Laravel\Boost\Console\InstallCommand;
66

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 {
88
putenv('WSL_DISTRO_NAME=Ubuntu');
99

10-
$command = new InstallCommand();
10+
$command = new InstallCommand;
1111
$reflection = new ReflectionClass($command);
1212
$method = $reflection->getMethod('isRunningInWsl');
13-
$method->setAccessible(true);
1413

1514
expect($method->invoke($command))->toBeTrue();
1615
});
1716

18-
test('isRunningInWsl returns true when IS_WSL is set', function () {
17+
test('isRunningInWsl returns true when IS_WSL is set', function (): void {
1918
putenv('IS_WSL=1');
2019

21-
$command = new InstallCommand();
20+
$command = new InstallCommand;
2221
$reflection = new ReflectionClass($command);
2322
$method = $reflection->getMethod('isRunningInWsl');
24-
$method->setAccessible(true);
2523

2624
expect($method->invoke($command))->toBeTrue();
2725
});
2826

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 {
3028
putenv('WSL_DISTRO_NAME=Ubuntu');
3129
putenv('IS_WSL=true');
3230

33-
$command = new InstallCommand();
31+
$command = new InstallCommand;
3432
$reflection = new ReflectionClass($command);
3533
$method = $reflection->getMethod('isRunningInWsl');
36-
$method->setAccessible(true);
3734

3835
expect($method->invoke($command))->toBeTrue();
3936
});
4037

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 {
4239
putenv('WSL_DISTRO_NAME');
4340
putenv('IS_WSL');
4441

45-
$command = new InstallCommand();
42+
$command = new InstallCommand;
4643
$reflection = new ReflectionClass($command);
4744
$method = $reflection->getMethod('isRunningInWsl');
48-
$method->setAccessible(true);
4945

5046
expect($method->invoke($command))->toBeFalse();
5147
});
5248

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 {
5450
putenv('WSL_DISTRO_NAME=');
5551
putenv('IS_WSL=');
5652

57-
$command = new InstallCommand();
53+
$command = new InstallCommand;
5854
$reflection = new ReflectionClass($command);
5955
$method = $reflection->getMethod('isRunningInWsl');
60-
$method->setAccessible(true);
6156

6257
expect($method->invoke($command))->toBeFalse();
6358
});

tests/Feature/Install/CodeEnvironment/CodeEnvironmentPathResolutionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
expect($cursor->getArtisanPath())->toBe('artisan');
3939
});
4040

41-
test('CodeEnvironment returns absolute paths when forceAbsolutePath is true', function () {
41+
test('CodeEnvironment returns absolute paths when forceAbsolutePath is true', function (): void {
4242
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class);
4343
$cursor = new Cursor($strategyFactory);
4444

@@ -47,15 +47,15 @@
4747
->and($cursor->getArtisanPath(true))->not()->toBe('artisan');
4848
});
4949

50-
test('CodeEnvironment maintains relative paths when forceAbsolutePath is false', function () {
50+
test('CodeEnvironment maintains relative paths when forceAbsolutePath is false', function (): void {
5151
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class);
5252
$cursor = new Cursor($strategyFactory);
5353

5454
expect($cursor->getPhpPath(false))->toBe('php');
5555
expect($cursor->getArtisanPath(false))->toBe('artisan');
5656
});
5757

58-
test('PhpStorm paths remain absolute regardless of forceAbsolutePath parameter', function () {
58+
test('PhpStorm paths remain absolute regardless of forceAbsolutePath parameter', function (): void {
5959
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class);
6060
$phpStorm = new PhpStorm($strategyFactory);
6161

tests/Unit/Install/CodeEnvironment/CodeEnvironmentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,12 @@ public function mcpConfigPath(): string
410410
->and($capturedContent)->toBe(fixture('mcp-expected.json5'));
411411
});
412412

413-
test('getPhpPath uses absolute paths when forceAbsolutePath is true', function () {
413+
test('getPhpPath uses absolute paths when forceAbsolutePath is true', function (): void {
414414
$environment = new TestCodeEnvironment($this->strategyFactory);
415415
expect($environment->getPhpPath(true))->toBe(PHP_BINARY);
416416
});
417417

418-
test('getPhpPath maintains default behavior when forceAbsolutePath is false', function () {
418+
test('getPhpPath maintains default behavior when forceAbsolutePath is false', function (): void {
419419
$environment = new TestCodeEnvironment($this->strategyFactory);
420420
expect($environment->getPhpPath(false))->toBe('php');
421421
});

0 commit comments

Comments
 (0)