Files
animethemes-server/tests/Feature/GraphQL/Queries/AnimeQueryTest.php
T
2025-07-29 23:31:12 -03:00

34 lines
703 B
PHP

<?php
declare(strict_types=1);
use App\Models\Wiki\Anime;
uses(Illuminate\Foundation\Testing\WithFaker::class);
test('anime years query', function () {
$this->markTestSkipped('TODO');
/** @phpstan-ignore-next-line */
$years = Anime::factory()
->count(fake()->randomDigitNotNull())
->create()
->map(fn (Anime $anime) => $anime->getAttribute(Anime::ATTRIBUTE_YEAR))
->sortBy(fn (int $year) => $year)
->unique()
->values()
->toArray();
$response = $this->graphQL('
{
animeyears
}
');
$response->assertJson([
'data' => [
'animeyears' => $years,
],
]);
});