File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 8
8
"php" : " ^8.1" ,
9
9
"composer-runtime-api" : " ^2.2" ,
10
10
"fakerphp/faker" : " ^1.21" ,
11
- "orchestra/workbench" : " ^8.9 |^9.5 " ,
11
+ "orchestra/workbench" : " ^8.11 |^9.7 " ,
12
12
"symfony/polyfill-php83" : " ^1.28"
13
13
},
14
14
"require-dev" : {
Original file line number Diff line number Diff line change 5
5
use Illuminate \Contracts \Console \Kernel as ConsoleKernel ;
6
6
use Illuminate \Filesystem \Filesystem ;
7
7
use Orchestra \Workbench \Events \InstallStarted ;
8
+ use RuntimeException ;
8
9
9
10
class InstallingWorkbench
10
11
{
@@ -25,6 +26,10 @@ public function __construct(
25
26
*/
26
27
public function handle (InstallStarted $ event )
27
28
{
29
+ if ($ event ->input ->hasOption ('basic ' ) && $ event ->input ->getOption ('basic ' ) === true ) {
30
+ throw new RuntimeException ('Nova Devtool does not support installation with --basic` option ' );
31
+ }
32
+
28
33
$ this ->kernel ->call ('make:user-model ' );
29
34
$ this ->kernel ->call ('make:user-factory ' );
30
35
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate \Console \View \Components \Factory as ViewComponent ;
4
+ use Laravel \Nova \DevTool \Listeners \InstallingWorkbench ;
5
+ use Mockery as m ;
6
+ use Orchestra \Workbench \Events \InstallStarted ;
7
+ use Symfony \Component \Console \Input \InputInterface ;
8
+ use Symfony \Component \Console \Output \OutputInterface ;
9
+
10
+ it ('can throw exception if installation with `--basic` option ' , function () {
11
+ $ listener = app (InstallingWorkbench::class);
12
+ $ event = new InstallStarted (
13
+ $ input = m::mock (InputInterface::class),
14
+ m::mock (OutputInterface::class),
15
+ m::mock (ViewComponent::class),
16
+ );
17
+
18
+ $ input ->shouldReceive ('hasOption ' )->with ('basic ' )->andReturnTrue ();
19
+ $ input ->shouldReceive ('getOption ' )->with ('basic ' )->andReturnTrue ();
20
+
21
+ $ listener ->handle ($ event );
22
+ })->throws (RuntimeException::class, 'Nova Devtool does not support installation with --basic` option ' );
Original file line number Diff line number Diff line change 14
14
*/
15
15
16
16
uses (Tests \TestCase::class)->in ('Feature ' );
17
+ // uses(PHPUnit\Framework\TestCase::class)->in('Unit');
17
18
18
19
/*
19
20
|--------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments