Skip to content

Commit 284f0fa

Browse files
authored
Merge pull request #2 from cbaconnier/pest
Add Pest
2 parents 2b60742 + 3a772a1 commit 284f0fa

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ It should **only** be used on a fresh installation.
1212
- Fresh installation of Laravel 8
1313
- Laravel Fortify _(optional)_
1414
- Laravel Jetstream _(optional)_
15+
- Laravel Pest _(optional)_
1516

1617
## Installation
1718
You can install the package via composer:

src/InstallCommand.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Cbaconnier\LaravelMvcToDdd\Installers\FortifyInstaller;
66
use Cbaconnier\LaravelMvcToDdd\Installers\JetstreamInstaller;
77
use Cbaconnier\LaravelMvcToDdd\Installers\LaravelInstaller;
8+
use Cbaconnier\LaravelMvcToDdd\Installers\PestInstaller;
89
use Illuminate\Console\Command;
910
use Illuminate\Support\Composer;
1011

@@ -17,13 +18,12 @@ class InstallCommand extends Command
1718
public function handle(
1819
LaravelInstaller $laravelInstaller,
1920
FortifyInstaller $fortifyInstaller,
20-
JetstreamInstaller $jetstreamInstaller
21+
JetstreamInstaller $jetstreamInstaller,
22+
PestInstaller $pestInstaller
2123
) {
2224
$this->info('Installing for Laravel...');
2325
$laravelInstaller->install();
2426

25-
26-
2727
if ($fortifyInstaller->enabled()) {
2828
$this->info('Installing for Fortify...');
2929
$fortifyInstaller->install();
@@ -34,6 +34,12 @@ public function handle(
3434
$jetstreamInstaller->install();
3535
}
3636

37+
38+
if ($pestInstaller->enabled()) {
39+
$this->info('Installing for Pest...');
40+
$pestInstaller->install();
41+
}
42+
3743
$this->info('Running composer dump autoload...');
3844
$this->updateComposer();
3945

src/Installers/PestInstaller.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Cbaconnier\LaravelMvcToDdd\Installers;
4+
5+
use Illuminate\Filesystem\Filesystem;
6+
7+
class PestInstaller extends Installer
8+
{
9+
10+
public function enabled(): bool
11+
{
12+
return file_exists(base_path('tests/Pest.php'));
13+
}
14+
15+
public function install(): void
16+
{
17+
$this->configureFiles();
18+
}
19+
20+
21+
protected function configureFiles()
22+
{
23+
/* Actions */
24+
25+
$this->replaceAllInFile([
26+
"->in('Feature')" => "->in('App', 'Domain', 'Support')",
27+
28+
], base_path('tests/Pest.php'));
29+
30+
}
31+
32+
33+
}

0 commit comments

Comments
 (0)