Commit 5bff1e8 1 parent 5c6784a commit 5bff1e8 Copy full SHA for 5bff1e8
File tree 1 file changed +18
-8
lines changed
1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,24 @@ public function handle()
64
64
65
65
$ contents = file_get_contents (base_path ('tests/Pest.php ' ));
66
66
67
- $ contents = str_replace ('<?php ' , <<<EOT
68
- <?php
69
-
70
- uses(
71
- Tests\DuskTestCase::class,
72
- // Illuminate\Foundation\Testing\DatabaseMigrations::class,
73
- )->in('Browser');
74
- EOT , $ contents );
67
+ if (str_contains ($ contents , 'uses( ' )) {
68
+ $ contents = str_replace ('<?php ' , <<<EOT
69
+ <?php
70
+
71
+ uses(
72
+ Tests\DuskTestCase::class,
73
+ // Illuminate\Foundation\Testing\DatabaseMigrations::class,
74
+ )->in('Browser');
75
+ EOT , $ contents );
76
+ } else {
77
+ $ contents = str_replace ('<?php ' , <<<EOT
78
+ <?php
79
+
80
+ pest()->extend(Tests\DuskTestCase::class)
81
+ // ->use(Illuminate\Foundation\Testing\DatabaseMigrations::class)
82
+ ->in('Browser');
83
+ EOT , $ contents );
84
+ }
75
85
76
86
file_put_contents (base_path ('tests/Pest.php ' ), $ contents );
77
87
} else {
You can’t perform that action at this time.
0 commit comments