-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTestCase.php
84 lines (71 loc) · 2.67 KB
/
TestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
namespace Coderflex\FilamentTurnstile\Tests;
use BladeUI\Heroicons\BladeHeroiconsServiceProvider;
use BladeUI\Icons\BladeIconsServiceProvider;
use Coderflex\FilamentTurnstile\FilamentTurnstileServiceProvider;
use Filament\Actions\ActionsServiceProvider;
use Filament\Facades\Filament;
use Filament\FilamentServiceProvider;
use Filament\Forms\FormsServiceProvider;
use Filament\Infolists\InfolistsServiceProvider;
use Filament\Notifications\NotificationsServiceProvider;
use Filament\Support\SupportServiceProvider;
use Filament\Tables\TablesServiceProvider;
use Filament\Widgets\WidgetsServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Livewire\LivewireServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
use RyanChandler\BladeCaptureDirective\BladeCaptureDirectiveServiceProvider;
class TestCase extends Orchestra
{
// protected $enablesPackageDiscoveries = true;
protected function setUp(): void
{
parent::setUp();
Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'Coderflex\\FilamentTurnstile\\Tests\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
config()->set('app.key', '6rE9Nz59bGRbeMATftriyQjrpF7DcOQm');
$this->setCurrentFilamentPanel();
}
protected function getPackageProviders($app)
{
return [
ActionsServiceProvider::class,
BladeCaptureDirectiveServiceProvider::class,
BladeHeroiconsServiceProvider::class,
BladeIconsServiceProvider::class,
FilamentServiceProvider::class,
FormsServiceProvider::class,
InfolistsServiceProvider::class,
LivewireServiceProvider::class,
NotificationsServiceProvider::class,
SupportServiceProvider::class,
TablesServiceProvider::class,
WidgetsServiceProvider::class,
FilamentTurnstileServiceProvider::class,
TurnstilePanelProvider::class,
];
}
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');
$app['config']->set('view.paths', [
...$app['config']->get('view.paths'),
__DIR__.'/resources/views',
]);
$migrations = [
include __DIR__.'/Database/Migrations/create_users_table.php',
include __DIR__.'/Database/Migrations/create_contacts_table.php',
];
collect($migrations)->each(
fn ($migration) => $migration->up()
);
}
protected function setCurrentFilamentPanel(): void
{
Filament::setCurrentPanel(
Filament::getPanel('turnstile')
);
}
}