1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Fix tests.

This commit is contained in:
Taylor Otwell
2016-05-17 19:43:24 -07:00
parent 24039873f2
commit 6e40e195ca

View File

@@ -157,7 +157,7 @@ public function test_linked_php_throws_exception_if_unsupported_php_version_is_l
public function test_install_or_fail_will_install_brew_formulas() public function test_install_or_fail_will_install_brew_formulas()
{ {
$cli = Mockery::mock(CommandLine::class); $cli = Mockery::mock(CommandLine::class);
$cli->shouldReceive('run')->once()->with('brew install dnsmasq', Mockery::type('Closure')); $cli->shouldReceive('runAsUser')->once()->with('brew install dnsmasq', Mockery::type('Closure'));
swap(CommandLine::class, $cli); swap(CommandLine::class, $cli);
resolve(Brew::class)->installOrFail('dnsmasq'); resolve(Brew::class)->installOrFail('dnsmasq');
} }
@@ -166,7 +166,7 @@ public function test_install_or_fail_will_install_brew_formulas()
public function test_install_or_fail_can_install_taps() public function test_install_or_fail_can_install_taps()
{ {
$cli = Mockery::mock(CommandLine::class); $cli = Mockery::mock(CommandLine::class);
$cli->shouldReceive('run')->once()->with('brew install dnsmasq', Mockery::type('Closure')); $cli->shouldReceive('runAsUser')->once()->with('brew install dnsmasq', Mockery::type('Closure'));
swap(CommandLine::class, $cli); swap(CommandLine::class, $cli);
$brew = Mockery::mock(Brew::class.'[tap]', [$cli, new Filesystem]); $brew = Mockery::mock(Brew::class.'[tap]', [$cli, new Filesystem]);
$brew->shouldReceive('tap')->once()->with(['test/tap']); $brew->shouldReceive('tap')->once()->with(['test/tap']);
@@ -180,8 +180,8 @@ public function test_install_or_fail_can_install_taps()
public function test_install_or_fail_throws_exception_on_failure() public function test_install_or_fail_throws_exception_on_failure()
{ {
$cli = Mockery::mock(CommandLine::class); $cli = Mockery::mock(CommandLine::class);
$cli->shouldReceive('run')->andReturnUsing(function ($command, $onError) { $cli->shouldReceive('runAsUser')->andReturnUsing(function ($command, $onError) {
$onError('test error ouput'); $onError(1, 'test error ouput');
}); });
swap(CommandLine::class, $cli); swap(CommandLine::class, $cli);
resolve(Brew::class)->installOrFail('dnsmasq'); resolve(Brew::class)->installOrFail('dnsmasq');