@@ -69,7 +69,7 @@ public function handle()
69
69
$ stubs = $ this ->getTestStubsPath ();
70
70
71
71
if ($ this ->option ('pest ' )) {
72
- $ this ->requireComposerPackages ('pestphp/pest:^1.16 ' , 'pestphp/pest-plugin-laravel:^1.1 ' );
72
+ $ this ->requireComposerDevPackages ('pestphp/pest:^1.16 ' , 'pestphp/pest-plugin-laravel:^1.1 ' );
73
73
74
74
copy ($ stubs .'/Pest.php ' , base_path ('tests/Pest.php ' ));
75
75
copy ($ stubs .'/ExampleTest.php ' , base_path ('tests/Feature/ExampleTest.php ' ));
@@ -603,6 +603,32 @@ protected function requireComposerPackages($packages)
603
603
});
604
604
}
605
605
606
+ /**
607
+ * Install the given Composer Packages as "dev" dependencies.
608
+ *
609
+ * @param mixed $packages
610
+ * @return void
611
+ */
612
+ protected function requireComposerDevPackages ($ packages )
613
+ {
614
+ $ composer = $ this ->option ('composer ' );
615
+
616
+ if ($ composer !== 'global ' ) {
617
+ $ command = [$ this ->phpBinary (), $ composer , 'require ' , '--dev ' ];
618
+ }
619
+
620
+ $ command = array_merge (
621
+ $ command ?? ['composer ' , 'require ' , '--dev ' ],
622
+ is_array ($ packages ) ? $ packages : func_get_args ()
623
+ );
624
+
625
+ (new Process ($ command , base_path (), ['COMPOSER_MEMORY_LIMIT ' => '-1 ' ]))
626
+ ->setTimeout (null )
627
+ ->run (function ($ type , $ output ) {
628
+ $ this ->output ->write ($ output );
629
+ });
630
+ }
631
+
606
632
/**
607
633
* Update the "package.json" file.
608
634
*
0 commit comments