mirror of
https://github.com/koel/koel
synced 2024-11-24 05:03:05 +00:00
fix(test): set fulltext search driver to tntsearch
This commit is contained in:
parent
3f5d95b0af
commit
2835bfedae
3 changed files with 10 additions and 21 deletions
|
@ -4,7 +4,6 @@ namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Throwable;
|
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
class RouteServiceProvider extends ServiceProvider
|
class RouteServiceProvider extends ServiceProvider
|
||||||
|
@ -33,7 +32,6 @@ class RouteServiceProvider extends ServiceProvider
|
||||||
|
|
||||||
private static function getApiVersion(): ?string
|
private static function getApiVersion(): ?string
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
// In the test environment, the route service provider is loaded _before_ the request is made,
|
// In the test environment, the route service provider is loaded _before_ the request is made,
|
||||||
// so we can't rely on the header.
|
// so we can't rely on the header.
|
||||||
// Instead, we manually set the API version as an env variable in applicable test cases.
|
// Instead, we manually set the API version as an env variable in applicable test cases.
|
||||||
|
@ -44,8 +42,5 @@ class RouteServiceProvider extends ServiceProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
return $version;
|
return $version;
|
||||||
} catch (Throwable) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<env name="APP_URL" value="http://localhost/"/>
|
<env name="APP_URL" value="http://localhost/"/>
|
||||||
<env name="APP_KEY" value="16efa6c23c2e8c705826b0e66778fbe7"/>
|
<env name="APP_KEY" value="16efa6c23c2e8c705826b0e66778fbe7"/>
|
||||||
<env name="CACHE_DRIVER" value="array"/>
|
<env name="CACHE_DRIVER" value="array"/>
|
||||||
<env name="SCOUT_DRIVER" value="database"/>
|
<env name="SCOUT_DRIVER" value="tntsearch"/> <!-- "database" driver doesn't support SQLite -->
|
||||||
<env name="SESSION_DRIVER" value="array"/>
|
<env name="SESSION_DRIVER" value="array"/>
|
||||||
<env name="QUEUE_DRIVER" value="sync"/>
|
<env name="QUEUE_DRIVER" value="sync"/>
|
||||||
<env name="DB_CONNECTION" value="sqlite"/>
|
<env name="DB_CONNECTION" value="sqlite"/>
|
||||||
|
|
|
@ -6,7 +6,6 @@ use App\Console\Kernel;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Contracts\Console\Kernel as Artisan;
|
use Illuminate\Contracts\Console\Kernel as Artisan;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Throwable;
|
|
||||||
|
|
||||||
trait CreatesApplication
|
trait CreatesApplication
|
||||||
{
|
{
|
||||||
|
@ -29,12 +28,7 @@ trait CreatesApplication
|
||||||
|
|
||||||
private function prepareForTests(): void
|
private function prepareForTests(): void
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$this->artisan->call('migrate');
|
$this->artisan->call('migrate');
|
||||||
} catch (Throwable $e) {
|
|
||||||
\Log::error($e); // @phpcs:ignore
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!User::count()) {
|
if (!User::count()) {
|
||||||
$this->artisan->call('db:seed');
|
$this->artisan->call('db:seed');
|
||||||
|
|
Loading…
Reference in a new issue