feat: migrer vers Symfony 8, PHP 8.4 et les dépendances majeures associées

- PHP 8.3 → 8.4 (Dockerfile + composer.json)
- Symfony 7.0 → 8.0 (tous les composants symfony/*)
- API Platform 3.x → 4.x : migration openapiContext → openapi: new Operation(...)
- Doctrine DBAL 3 → 4 : suppression use_savepoints, replace prepare/executeQuery
- Doctrine ORM 2.x → 3.x : ClassMetadataInfo → ClassMetadata, setParameters → setParameter
- Doctrine Bundle 2.x → 3.x, Fixtures Bundle 3.x → 4.x
- zenstruck/foundry 1.x → 2.x : ModelFactory → PersistentObjectFactory, getDefaults → defaults
- phpmd/phpmd 2.x → 3.x-dev (seule version supportant Symfony 8)
- phparkitect 0.3 → 0.8 : NotDependsOnTheseNamespaces prend un array
- symfony/mercure-bundle 0.3 → 0.4, symfony/monolog-bundle 3 → 4
- Suppression de runtime/frankenphp-symfony (intégré nativement dans symfony/runtime 8)
- worker.Caddyfile : suppression de APP_RUNTIME (détection automatique Symfony 8)
- Routes errors.xml/wdt.xml/profiler.xml → .php (Symfony 8 supprime le XML)
- Types::ARRAY → Types::JSON dans Entity/Manga.php (DBAL 4 retire array type)
- Suppression de src/Schedule.php (doublon vide avec MonitoringSchedule)
- Tests : hydra:Collection → Collection, hydra:member → member (API Platform 4)
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-26 17:55:12 +01:00
parent 5a0888eb28
commit 5ed303612a
371 changed files with 6194 additions and 4160 deletions

View File

@@ -9,7 +9,6 @@ use App\Tests\Factory\MangaFactory;
use App\Tests\Feature\AbstractApiTestCase;
use Symfony\Component\HttpFoundation\Response;
use Zenstruck\Foundry\Test\ResetDatabase;
use ZipArchive;
final class GetChapterPagesTest extends AbstractApiTestCase
{
@@ -23,16 +22,16 @@ final class GetChapterPagesTest extends AbstractApiTestCase
parent::setUp();
// Extraire quelques images du CBZ dans un dossier temporaire
$this->pagesDirectory = sys_get_temp_dir() . '/mangarr-test-pages-' . uniqid();
$this->pagesDirectory = sys_get_temp_dir().'/mangarr-test-pages-'.uniqid();
mkdir($this->pagesDirectory);
$zip = new ZipArchive();
$zip->open(__DIR__ . '/../../Fixtures/chapter.cbz');
$zip = new \ZipArchive();
$zip->open(__DIR__.'/../../Fixtures/chapter.cbz');
$zip->extractTo($this->pagesDirectory, ['007.jpg', '008.jpg']);
$zip->close();
$manga = MangaFactory::createOne([
'title' => 'Test Manga',
'slug' => 'test-manga'
'slug' => 'test-manga',
]);
$chapter = ChapterFactory::createOne([
@@ -41,7 +40,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
'number' => 1.0,
'volume' => 1,
'visible' => true,
'pagesDirectory' => $this->pagesDirectory
'pagesDirectory' => $this->pagesDirectory,
]);
$this->chapterId = $chapter->getId();
@@ -51,7 +50,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
{
parent::tearDown();
foreach (glob($this->pagesDirectory . '/*') as $file) {
foreach (glob($this->pagesDirectory.'/*') as $file) {
unlink($file);
}
rmdir($this->pagesDirectory);
@@ -63,7 +62,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
$this->assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
$this->assertJsonContains([
'detail' => 'Le chapitre 999 n\'existe pas'
'detail' => 'Le chapitre 999 n\'existe pas',
]);
}
@@ -99,8 +98,8 @@ final class GetChapterPagesTest extends AbstractApiTestCase
$response = static::createClient()->request('GET', "/api/reader/chapter/{$this->chapterId}/pages", [
'query' => [
'page' => 1,
'itemsPerPage' => 5
]
'itemsPerPage' => 5,
],
]);
$this->assertResponseIsSuccessful();
@@ -133,7 +132,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
// Créer un chapitre sans fichier CBZ
$manga = MangaFactory::createOne([
'title' => 'Empty Manga',
'slug' => 'empty-manga'
'slug' => 'empty-manga',
]);
$emptyChapter = ChapterFactory::createOne([
@@ -142,7 +141,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
'number' => 1.0,
'volume' => 1,
'visible' => true,
'cbzPath' => null
'cbzPath' => null,
]);
$response = static::createClient()->request('GET', "/api/reader/chapter/{$emptyChapter->getId()}/pages");
@@ -155,8 +154,8 @@ final class GetChapterPagesTest extends AbstractApiTestCase
{
$response = static::createClient()->request('GET', "/api/reader/chapter/{$this->chapterId}/pages", [
'query' => [
'page' => -1
]
'page' => -1,
],
]);
$this->assertResponseIsSuccessful();
@@ -167,11 +166,11 @@ final class GetChapterPagesTest extends AbstractApiTestCase
{
$response = static::createClient()->request('GET', "/api/reader/chapter/{$this->chapterId}/pages", [
'query' => [
'itemsPerPage' => 0
]
'itemsPerPage' => 0,
],
]);
//TODO: Corriger la fonctionnalité de pagination pour que l'endpoint retourne une erreur 400 quand itemsPerPage est 0 (division par zéro)
// TODO: Corriger la fonctionnalité de pagination pour que l'endpoint retourne une erreur 400 quand itemsPerPage est 0 (division par zéro)
$this->assertResponseStatusCodeSame(Response::HTTP_INTERNAL_SERVER_ERROR);
// L'endpoint retourne une erreur 500 quand itemsPerPage est 0 (division par zéro)
}
@@ -180,7 +179,7 @@ final class GetChapterPagesTest extends AbstractApiTestCase
{
$response = static::createClient()->request('GET', '/api/reader/chapter/invalid-id/pages');
//TODO: Corriger le cas où l'ID est invalide
// TODO: Corriger le cas où l'ID est invalide
$this->assertResponseStatusCodeSame(Response::HTTP_INTERNAL_SERVER_ERROR);
// L'endpoint retourne une erreur 500 quand l'ID est invalide
}