@@ -66,21 +66,38 @@ 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 ' )->once ()->with ('php71 ' )->andReturn (true );
70- $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (true );
71- $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (true );
69+ $ brew ->shouldReceive ('installed ' )->with ('php72 ' )->andReturn (true );
70+ $ brew ->shouldReceive ('installed ' )->with ('php71 ' )->andReturn (false );
71+ $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (false );
72+ $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (false );
73+ $ this ->assertTrue ($ brew ->hasInstalledPhp ());
74+
75+ $ brew = Mockery::mock (Brew::class.'[installed] ' , [new CommandLine , new Filesystem ]);
76+ $ brew ->shouldReceive ('installed ' )->with ('php72 ' )->andReturn (false );
77+ $ brew ->shouldReceive ('installed ' )->with ('php71 ' )->andReturn (true );
78+ $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (false );
79+ $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (false );
7280 $ this ->assertTrue ($ brew ->hasInstalledPhp ());
7381
7482 $ brew = Mockery::mock (Brew::class.'[installed] ' , [new CommandLine , new Filesystem ]);
75- $ brew ->shouldReceive ('installed ' )->once ()-> with ('php70 ' )->andReturn (true );
83+ $ brew ->shouldReceive ('installed ' )->with ('php72 ' )->andReturn (false );
7684 $ brew ->shouldReceive ('installed ' )->with ('php71 ' )->andReturn (false );
85+ $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (true );
7786 $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (false );
7887 $ this ->assertTrue ($ brew ->hasInstalledPhp ());
7988
8089 $ brew = Mockery::mock (Brew::class.'[installed] ' , [new CommandLine , new Filesystem ]);
81- $ brew ->shouldReceive ('installed ' )->once ()->with ('php71 ' )->andReturn (false );
82- $ brew ->shouldReceive ('installed ' )->once ()->with ('php70 ' )->andReturn (false );
83- $ brew ->shouldReceive ('installed ' )->once ()->with ('php56 ' )->andReturn (false );
90+ $ brew ->shouldReceive ('installed ' )->with ('php72 ' )->andReturn (false );
91+ $ brew ->shouldReceive ('installed ' )->with ('php71 ' )->andReturn (false );
92+ $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (false );
93+ $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (true );
94+ $ this ->assertTrue ($ brew ->hasInstalledPhp ());
95+
96+ $ brew = Mockery::mock (Brew::class.'[installed] ' , [new CommandLine , new Filesystem ]);
97+ $ brew ->shouldReceive ('installed ' )->with ('php72 ' )->andReturn (false );
98+ $ brew ->shouldReceive ('installed ' )->with ('php71 ' )->andReturn (false );
99+ $ brew ->shouldReceive ('installed ' )->with ('php70 ' )->andReturn (false );
100+ $ brew ->shouldReceive ('installed ' )->with ('php56 ' )->andReturn (false );
84101 $ this ->assertFalse ($ brew ->hasInstalledPhp ());
85102 }
86103
0 commit comments