jikan-rest/database/factories/MagazineFactory.php
pushrbx a530e9f5d6 multiple changes
- 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
2023-05-21 11:18:02 +01:00

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
];
}
}