1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

add more tests for new methods and bits of clean up

This commit is contained in:
James Barnard
2019-01-19 23:31:57 +00:00
committed by Matt Stauffer
parent 25c4fab2b4
commit 6158e5129b
5 changed files with 121 additions and 27 deletions

View File

@@ -1,7 +1,9 @@
<?php
use Valet\Brew;
use Valet\PhpFpm;
use function Valet\user;
use function Valet\swap;
use function Valet\resolve;
use Illuminate\Container\Container;
@@ -36,6 +38,29 @@ public function test_fpm_is_configured_with_the_correct_user_group_and_port()
$this->assertContains("\nlisten = ".VALET_HOME_PATH."/valet.sock", $contents);
}
public function test_stopRunning_will_pass_filtered_result_of_getRunningServices_to_stopService()
{
$brewMock = Mockery::mock(Brew::class);
$brewMock->shouldReceive('getRunningServices')->once()
->andReturn(collect([
'php7.2',
'php@7.3',
'php56',
'php',
'nginx',
'somethingelse',
]));
$brewMock->shouldReceive('stopService')->once()->with([
'php7.2',
'php@7.3',
'php56',
'php',
]);
swap(Brew::class, $brewMock);
resolve(PhpFpm::class)->stopRunning();
}
// TODO: useVersion if no php at start it will prefix
// TODO: useVersion will pass version to Brew::search and then check if it's supported
// TODO: - if not supported will through
@@ -43,8 +68,6 @@ public function test_fpm_is_configured_with_the_correct_user_group_and_port()
// TODO: useVersion will ensure new version is installed
// TODO: useVersion will link found version (force)
// TODO: useVersion will call install at end
// TODO: stopRunning will get the running php services and stop them
}