|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | use Illuminate\Console\View\Components\Factory as ViewComponent;
|
4 |
| -use Illuminate\Contracts\Console\Kernel as ConsoleKernel; |
5 | 4 | use Illuminate\Filesystem\Filesystem;
|
6 | 5 | use Laravel\Nova\DevTool\Listeners\InstallingWorkbench;
|
7 | 6 | use Mockery as m;
|
8 | 7 | use Orchestra\Workbench\Events\InstallStarted;
|
9 | 8 | use Symfony\Component\Console\Input\InputInterface;
|
10 | 9 | use Symfony\Component\Console\Output\OutputInterface;
|
11 | 10 |
|
12 |
| -it('can make user model and factory if installation without `--basic` option', function () { |
13 |
| - $kernel = m::mock(ConsoleKernel::class); |
14 |
| - |
15 |
| - $listener = new InstallingWorkbench($kernel, new Filesystem); |
16 |
| - |
17 |
| - $event = new InstallStarted( |
18 |
| - $input = m::mock(InputInterface::class), |
19 |
| - m::mock(OutputInterface::class), |
20 |
| - m::mock(ViewComponent::class), |
21 |
| - ); |
22 |
| - |
23 |
| - $input->shouldReceive('hasOption')->with('basic')->andReturnTrue(); |
24 |
| - $input->shouldReceive('getOption')->with('basic')->andReturnFalse(); |
25 |
| - |
26 |
| - $kernel->shouldReceive('call')->with('make:user-model')->once(); |
27 |
| - $kernel->shouldReceive('call')->with('make:user-factory')->once(); |
28 |
| - |
29 |
| - $listener->handle($event); |
30 |
| -}); |
31 |
| - |
32 | 11 | it('can throw exception if installation with `--basic` option', function () {
|
33 |
| - $kernel = m::mock(ConsoleKernel::class); |
34 |
| - |
35 |
| - $listener = new InstallingWorkbench($kernel, new Filesystem); |
| 12 | + $listener = new InstallingWorkbench(new Filesystem); |
36 | 13 |
|
37 | 14 | $event = new InstallStarted(
|
38 | 15 | $input = m::mock(InputInterface::class),
|
|
43 | 20 | $input->shouldReceive('hasOption')->with('basic')->andReturnTrue();
|
44 | 21 | $input->shouldReceive('getOption')->with('basic')->andReturnTrue();
|
45 | 22 |
|
46 |
| - $kernel->shouldReceive('call')->with('make:user-model')->never(); |
47 |
| - $kernel->shouldReceive('call')->with('make:user-factory')->never(); |
48 |
| - |
49 | 23 | $listener->handle($event);
|
50 | 24 | })->throws(RuntimeException::class, 'Nova Devtool does not support installation with --basic` option');
|
0 commit comments