33namespace Illuminated \Helpers \Artisan ;
44
55use Illuminated \Helpers \HelperFunctions \Tests \TestCase ;
6- use Mockery ;
76
87class CommandTest extends TestCase
98{
109 protected function setUp ()
1110 {
1211 parent ::setUp ();
1312
14- $ phpBinaryMock = Mockery:: mock ('overload:Symfony\Component\Process\PhpExecutableFinder ' );
15- $ phpBinaryMock ->shouldReceive ( ' find ' )->withNoArgs ()-> once ()->andReturn ('php ' );
13+ $ phpBinaryMock = mock ('overload:Symfony\Component\Process\PhpExecutableFinder ' );
14+ $ phpBinaryMock ->expects ( )->find ()->andReturn ('php ' );
1615 }
1716
1817 /** @test */
@@ -32,7 +31,7 @@ public function it_has_static_constructor_named_factory()
3231 /** @test */
3332 public function it_can_run_command_in_background ()
3433 {
35- $ this ->shouldReceiveExecCallOnceWith ('(php artisan test:command) > /dev/null 2>&1 & ' );
34+ $ this ->expectsExecWith ('(php artisan test:command) > /dev/null 2>&1 & ' );
3635
3736 $ command = Command::factory ('test:command ' );
3837 $ command ->runInBackground ();
@@ -41,7 +40,7 @@ public function it_can_run_command_in_background()
4140 /** @test */
4241 public function run_in_background_supports_before_subcommand ()
4342 {
44- $ this ->shouldReceiveExecCallOnceWith ('(before command && php artisan test:command) > /dev/null 2>&1 & ' );
43+ $ this ->expectsExecWith ('(before command && php artisan test:command) > /dev/null 2>&1 & ' );
4544
4645 $ command = Command::factory ('test:command ' , 'before command ' );
4746 $ command ->runInBackground ();
@@ -50,7 +49,7 @@ public function run_in_background_supports_before_subcommand()
5049 /** @test */
5150 public function run_in_background_supports_after_subcommand ()
5251 {
53- $ this ->shouldReceiveExecCallOnceWith ('(php artisan test:command && after command) > /dev/null 2>&1 & ' );
52+ $ this ->expectsExecWith ('(php artisan test:command && after command) > /dev/null 2>&1 & ' );
5453
5554 $ command = Command::factory ('test:command ' , null , 'after command ' );
5655 $ command ->runInBackground ();
@@ -59,7 +58,7 @@ public function run_in_background_supports_after_subcommand()
5958 /** @test */
6059 public function run_in_background_supports_before_and_after_subcommands_together ()
6160 {
62- $ this ->shouldReceiveExecCallOnceWith ('(before && php artisan test:command && after) > /dev/null 2>&1 & ' );
61+ $ this ->expectsExecWith ('(before && php artisan test:command && after) > /dev/null 2>&1 & ' );
6362
6463 $ command = Command::factory ('test:command ' , 'before ' , 'after ' );
6564 $ command ->runInBackground ();
@@ -72,7 +71,7 @@ public function run_in_background_supports_before_and_after_subcommands_together
7271 */
7372 public function it_supports_overriding_of_artisan_binary_through_constant ()
7473 {
75- $ this ->shouldReceiveExecCallOnceWith ('(before && php custom-artisan test:command && after) > /dev/null 2>&1 & ' );
74+ $ this ->expectsExecWith ('(before && php custom-artisan test:command && after) > /dev/null 2>&1 & ' );
7675
7776 define ('ARTISAN_BINARY ' , 'custom-artisan ' );
7877 $ command = Command::factory ('test:command ' , 'before ' , 'after ' );
0 commit comments