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
23 lines
661 B
PHP
23 lines
661 B
PHP
<?php
|
|
|
|
use App\JikanApiModel;
|
|
use PackageVersions\Versions;
|
|
use HaydenPierce\ClassFinder\ClassFinder;
|
|
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
|
|
/*
|
|
Defines
|
|
*/
|
|
defined('JIKAN_PARSER_VERSION') or define('JIKAN_PARSER_VERSION', Versions::getVersion('jikan-me/jikan'));
|
|
|
|
|
|
$classNamesCachePath = __DIR__ . "/../storage/app";
|
|
// this line only works if dev dependencies are installed
|
|
$classes = ClassFinder::getClassesInNamespace("App");
|
|
$jikanModels = array_values(
|
|
array_filter($classes, fn($class) => is_subclass_of($class, JikanApiModel::class))
|
|
);
|
|
file_put_contents($classNamesCachePath . "/jikan_model_classes.json", json_encode($jikanModels));
|
|
|