mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fixed "runScoutFlush" function for tests
This commit is contained in:
parent
72b6bb9442
commit
eeb825940a
@ -97,7 +97,7 @@ trait JikanDataGenerator
|
||||
|
||||
private function createMalId(): int
|
||||
{
|
||||
return $this->faker->numberBetween(1, 99999);
|
||||
return $this->faker->unique()->numberBetween(1, 99999);
|
||||
}
|
||||
|
||||
private function createTitle(): string
|
||||
|
@ -6,11 +6,9 @@ trait ScoutFlush
|
||||
{
|
||||
public function runScoutFlush(): void
|
||||
{
|
||||
$this->artisan("scout:flush App\\Anime");
|
||||
$this->artisan("scout:flush App\\Manga");
|
||||
$this->artisan("scout:flush App\\Character");
|
||||
$this->artisan("scout:flush App\\GenreAnime");
|
||||
$this->artisan("scout:flush App\\GenreManga");
|
||||
$this->artisan("scout:flush App\\Person");
|
||||
$models = ["App\\Anime", "App\\Manga", "App\\Character", "App\\GenreAnime", "App\\GenreManga", "App\\Person"];
|
||||
foreach ($models as $model) {
|
||||
$this->artisan("scout:flush", ["model" => $model]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ abstract class TestCase extends Laravel\Lumen\Testing\TestCase
|
||||
return $app;
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
protected function setUpTraits()
|
||||
{
|
||||
parent::tearDown();
|
||||
parent::setUpTraits();
|
||||
$uses = array_flip(class_uses_recursive(get_class($this)));
|
||||
|
||||
// we want to empty the search index
|
||||
|
Loading…
x
Reference in New Issue
Block a user