File tree Expand file tree Collapse file tree 5 files changed +22
-32
lines changed Expand file tree Collapse file tree 5 files changed +22
-32
lines changed Original file line number Diff line number Diff line change 6
6
docs
7
7
phpunit.xml
8
8
phpstan.neon
9
- testbench.yaml
10
9
vendor
11
10
node_modules
12
- resources /js /* .log
11
+ resources /js /* .log
Original file line number Diff line number Diff line change 27
27
"laravel/pint" : " ^1.0" ,
28
28
"nunomaduro/collision" : " ^7.9" ,
29
29
"nunomaduro/larastan" : " ^2.0.1" ,
30
- "orchestra/testbench" : " ^8.0 " ,
30
+ "orchestra/testbench" : " ^8.18 " ,
31
31
"pestphp/pest" : " ^2.0" ,
32
32
"pestphp/pest-plugin-arch" : " ^2.0" ,
33
33
"pestphp/pest-plugin-laravel" : " ^2.0" ,
Original file line number Diff line number Diff line change
1
+ providers :
2
+ - Native\Electron\ElectronServiceProvider
3
+
4
+ migrations : false
5
+
6
+ workbench :
7
+ install : false
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use Illuminate \Support \Facades \Process ;
4
- use Symfony \Component \Process \PhpExecutableFinder ;
5
4
6
- it ('can boot up the app ' , function () {
7
- $ executableFinder = new PhpExecutableFinder ();
8
- $ php = $ executableFinder ->find (false );
9
-
10
- copy (
11
- from: __DIR__ .'/fixtures/artisan ' ,
12
- to: base_path ('artisan ' ),
13
- );
5
+ use function Orchestra \Testbench \remote ;
14
6
15
- $ process = Process:: path ( base_path ())
16
- -> tty ()
17
- -> start ($ php . ' artisan native:serve ' , function ($ type , $ line ) {
18
- echo $ line ;
19
- });
7
+ it ( ' can boot up the app ' , function () {
8
+ $ process = remote ( ' native:serve ' );
9
+ $ process -> setTty ( true )-> start (function ($ type , $ line ) {
10
+ echo $ line ;
11
+ });
20
12
21
13
try {
22
14
retry (12 , function () {
28
20
}
29
21
}, 5000 );
30
22
} catch (Exception $ e ) {
31
- Process::run ('pkill -9 -P ' .$ process ->id ());
23
+ Process::run ('pkill -9 -P ' .$ process ->getPid ());
32
24
throw $ e ;
33
25
}
34
26
35
- Process::run ('pkill -9 -P ' .$ process ->id ());
27
+ Process::run ('pkill -9 -P ' .$ process ->getPid ());
36
28
37
29
expect (true )->toBeTrue ();
38
30
});
Original file line number Diff line number Diff line change 3
3
namespace Native \Electron \Tests ;
4
4
5
5
use Illuminate \Support \Facades \Artisan ;
6
- use Native \Electron \ElectronServiceProvider ;
6
+ use Orchestra \Testbench \Attributes \WithConfig ;
7
+ use Orchestra \Testbench \Concerns \WithWorkbench ;
7
8
use Orchestra \Testbench \TestCase as Orchestra ;
8
9
10
+ #[WithConfig('database.default ' , 'testing ' )]
9
11
class TestCase extends Orchestra
10
12
{
13
+ use WithWorkbench;
14
+
11
15
protected function setUp (): void
12
16
{
13
17
parent ::setUp ();
14
18
15
19
Artisan::call ('native:install ' , ['--force ' => true ]);
16
20
}
17
-
18
- protected function getPackageProviders ($ app ): array
19
- {
20
- return [
21
- ElectronServiceProvider::class,
22
- ];
23
- }
24
-
25
- public function getEnvironmentSetUp ($ app ): void
26
- {
27
- config ()->set ('database.default ' , 'testing ' );
28
- }
29
21
}
You can’t perform that action at this time.
0 commit comments