adrema/tests/EndToEndTestCase.php

34 lines
783 B
PHP
Raw Normal View History

2024-01-28 11:42:32 +01:00
<?php
namespace Tests;
2024-01-30 00:49:22 +01:00
use App\Form\Models\Form;
use App\Member\Member;
use Laravel\Scout\Console\FlushCommand;
use Laravel\Scout\Console\SyncIndexSettingsCommand;
2024-01-28 11:42:32 +01:00
use Illuminate\Foundation\Testing\DatabaseMigrations;
2024-01-30 00:49:22 +01:00
use Illuminate\Support\Facades\Artisan;
2024-01-28 11:42:32 +01:00
abstract class EndToEndTestCase extends TestCase
{
use DatabaseMigrations;
2024-09-21 18:56:53 +02:00
protected function setUp(): void
2024-01-28 11:42:32 +01:00
{
parent::setUp();
$this->useMeilisearch();
}
2024-01-30 00:49:22 +01:00
public function useMeilisearch(): self
{
config()->set('scout.driver', 'meilisearch');
Artisan::call(FlushCommand::class, ['model' => Member::class]);
Artisan::call(FlushCommand::class, ['model' => Form::class]);
Artisan::call(SyncIndexSettingsCommand::class);
return $this;
}
2024-01-28 11:42:32 +01:00
}