|
1 | 1 | <?php |
2 | 2 |
|
3 | | -use Mockery as m; |
4 | | - |
| 3 | +// use Mockery as m; |
| 4 | +// |
5 | 5 | // /** |
6 | 6 | // * @runTestsInSeparateProcesses |
7 | 7 | // * @preserveGlobalState disabled |
8 | 8 | // */ |
9 | | -class CallInBackgroundTest extends TestCase |
10 | | -{ |
11 | | - protected function setUp() |
12 | | - { |
13 | | - $phpMock = m::mock('overload:Symfony\Component\Process\PhpExecutableFinder'); |
14 | | - $phpMock->shouldReceive('find')->with(false)->once()->andReturn('php'); |
15 | | - |
16 | | - $utilsMock = m::mock('alias:Symfony\Component\Process\ProcessUtils'); |
17 | | - $utilsMock->shouldReceive('escapeArgument')->withAnyArgs()->atLeast()->once()->andReturnUsing(function ($v) { |
18 | | - return $v; |
19 | | - }); |
20 | | - } |
21 | | - |
22 | | - /** @test */ |
23 | | - public function it_works_without_before_and_after_parameters() |
24 | | - { |
25 | | - $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
26 | | - $mock->shouldReceive('exec')->with('(php artisan test command) > /dev/null 2>&1 &')->once(); |
27 | | - |
28 | | - call_in_background('test command'); |
29 | | - } |
30 | | - |
31 | | - // /** @test */ |
32 | | - // public function it_works_with_only_before_parameter() |
33 | | - // { |
34 | | - // $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
35 | | - // $mock->shouldReceive('exec')->with('(before command && php artisan test command) > /dev/null 2>&1 &')->once(); |
36 | | - // |
37 | | - // call_in_background('test command', 'before command'); |
38 | | - // } |
39 | | - // |
40 | | - // /** @test */ |
41 | | - // public function it_works_with_only_after_parameter() |
42 | | - // { |
43 | | - // $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
44 | | - // $mock->shouldReceive('exec')->with('(php artisan test command && after command) > /dev/null 2>&1 &')->once(); |
45 | | - // |
46 | | - // call_in_background('test command', null, 'after command'); |
47 | | - // } |
48 | | - // |
49 | | - // /** @test */ |
50 | | - // public function it_works_with_before_and_after_parameters() |
51 | | - // { |
52 | | - // $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
53 | | - // $mock->shouldReceive('exec')->with('(before && php artisan test command && after) > /dev/null 2>&1 &')->once(); |
54 | | - // |
55 | | - // call_in_background('test command', 'before', 'after'); |
56 | | - // } |
57 | | -} |
| 9 | +// class CallInBackgroundTest extends TestCase |
| 10 | +// { |
| 11 | +// protected function setUp() |
| 12 | +// { |
| 13 | +// $phpMock = m::mock('overload:Symfony\Component\Process\PhpExecutableFinder'); |
| 14 | +// $phpMock->shouldReceive('find')->with(false)->once()->andReturn('php'); |
| 15 | +// |
| 16 | +// $utilsMock = m::mock('alias:Symfony\Component\Process\ProcessUtils'); |
| 17 | +// $utilsMock->shouldReceive('escapeArgument')->withAnyArgs()->atLeast()->once()->andReturnUsing(function ($v) { |
| 18 | +// return $v; |
| 19 | +// }); |
| 20 | +// } |
| 21 | +// |
| 22 | +// /** @test */ |
| 23 | +// public function it_works_without_before_and_after_parameters() |
| 24 | +// { |
| 25 | +// $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
| 26 | +// $mock->shouldReceive('exec')->with('(php artisan test command) > /dev/null 2>&1 &')->once(); |
| 27 | +// |
| 28 | +// call_in_background('test command'); |
| 29 | +// } |
| 30 | +// |
| 31 | +// /** @test */ |
| 32 | +// public function it_works_with_only_before_parameter() |
| 33 | +// { |
| 34 | +// $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
| 35 | +// $mock->shouldReceive('exec')->with('(before command && php artisan test command) > /dev/null 2>&1 &')->once(); |
| 36 | +// |
| 37 | +// call_in_background('test command', 'before command'); |
| 38 | +// } |
| 39 | +// |
| 40 | +// /** @test */ |
| 41 | +// public function it_works_with_only_after_parameter() |
| 42 | +// { |
| 43 | +// $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
| 44 | +// $mock->shouldReceive('exec')->with('(php artisan test command && after command) > /dev/null 2>&1 &')->once(); |
| 45 | +// |
| 46 | +// call_in_background('test command', null, 'after command'); |
| 47 | +// } |
| 48 | +// |
| 49 | +// /** @test */ |
| 50 | +// public function it_works_with_before_and_after_parameters() |
| 51 | +// { |
| 52 | +// $mock = m::mock('alias:Illuminated\Helpers\System\Command'); |
| 53 | +// $mock->shouldReceive('exec')->with('(before && php artisan test command && after) > /dev/null 2>&1 &')->once(); |
| 54 | +// |
| 55 | +// call_in_background('test command', 'before', 'after'); |
| 56 | +// } |
| 57 | +// } |
0 commit comments