mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
- wip -> http tests should use model factories - test runner bootstrap: jikan models are cached in a temporary file - fixed various bugs - improved test execution time with typesense - added new dev dependency: ClassFinder - updated composer scripts to include coverage generation - added coverage reports in phpunit - improved roadrunner integration - updated docker image - added xdebug in disabled state
34 lines
723 B
PHP
34 lines
723 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Magazine;
|
|
use App\Testing\JikanDataGenerator;
|
|
|
|
final class MagazineFactory extends JikanModelFactory
|
|
{
|
|
use JikanDataGenerator;
|
|
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Magazine::class;
|
|
|
|
protected function definitionInternal(): array
|
|
{
|
|
$mal_id = $this->createMalId();
|
|
$name = $this->createTitle();
|
|
$url = $this->createMalUrl($mal_id, "manga/magazine");
|
|
$count = $this->faker->numberBetween(1, 999);
|
|
|
|
return [
|
|
"mal_id" => $mal_id,
|
|
"name" => $name,
|
|
"url" => $url,
|
|
"count" => $count
|
|
];
|
|
}
|
|
}
|