Skip to content

Commit 567d38e

Browse files
committed
update tests
1 parent 884753b commit 567d38e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/BrewTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,39 @@ public function test_installed_returns_false_when_given_formula_is_not_installed
6666
public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
6767
{
6868
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
69+
$brew->shouldReceive('installed')->with('php')->andReturn(true);
6970
$brew->shouldReceive('installed')->with('php72')->andReturn(true);
7071
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
7172
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
7273
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
7374
$this->assertTrue($brew->hasInstalledPhp());
7475

7576
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
77+
$brew->shouldReceive('installed')->with('php')->andReturn(false);
7678
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
7779
$brew->shouldReceive('installed')->with('php71')->andReturn(true);
7880
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
7981
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
8082
$this->assertTrue($brew->hasInstalledPhp());
8183

8284
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
85+
$brew->shouldReceive('installed')->with('php')->andReturn(false);
8386
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
8487
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
8588
$brew->shouldReceive('installed')->with('php70')->andReturn(true);
8689
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
8790
$this->assertTrue($brew->hasInstalledPhp());
8891

8992
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
93+
$brew->shouldReceive('installed')->with('php')->andReturn(false);
9094
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
9195
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
9296
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
9397
$brew->shouldReceive('installed')->with('php56')->andReturn(true);
9498
$this->assertTrue($brew->hasInstalledPhp());
9599

96100
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
101+
$brew->shouldReceive('installed')->with('php')->andReturn(false);
97102
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
98103
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
99104
$brew->shouldReceive('installed')->with('php70')->andReturn(false);

0 commit comments

Comments
 (0)