Skip to content

Commit

Permalink
[8.x] Adds Pest 3 support (#1141)
Browse files Browse the repository at this point in the history
* Adds Pest 3 support

* Apply fixes from StyleCI

* Update InstallCommand.php

* Update InstallCommand.php

---------

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
nunomaduro and StyleCIBot authored Oct 4, 2024
1 parent 5c6784a commit 5bff1e8
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,24 @@ public function handle()

$contents = file_get_contents(base_path('tests/Pest.php'));

$contents = str_replace('<?php', <<<EOT
<?php
uses(
Tests\DuskTestCase::class,
// Illuminate\Foundation\Testing\DatabaseMigrations::class,
)->in('Browser');
EOT, $contents);
if (str_contains($contents, 'uses(')) {
$contents = str_replace('<?php', <<<EOT
<?php
uses(
Tests\DuskTestCase::class,
// Illuminate\Foundation\Testing\DatabaseMigrations::class,
)->in('Browser');
EOT, $contents);
} else {
$contents = str_replace('<?php', <<<EOT
<?php
pest()->extend(Tests\DuskTestCase::class)
// ->use(Illuminate\Foundation\Testing\DatabaseMigrations::class)
->in('Browser');
EOT, $contents);
}

file_put_contents(base_path('tests/Pest.php'), $contents);
} else {
Expand Down

0 comments on commit 5bff1e8

Please sign in to comment.