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:
parent
5a0888eb28
commit
5ed303612a
@@ -12,7 +12,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
{
|
||||
use ResetDatabase;
|
||||
|
||||
public function test_it_finds_exact_match_by_filename(): void
|
||||
public function testItFindsExactMatchByFilename(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('One Piece', 'one-piece');
|
||||
@@ -21,8 +21,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'one-piece_vol108_ch1094.cbz'
|
||||
]
|
||||
'filename' => 'one-piece_vol108_ch1094.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -37,10 +37,9 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertEquals(1094.0, $data['matches'][0]['chapterNumber']);
|
||||
$this->assertEquals(108, $data['matches'][0]['volumeNumber']);
|
||||
$this->assertGreaterThan(0, $data['matches'][0]['matchScore']);
|
||||
|
||||
}
|
||||
|
||||
public function test_it_returns_empty_matches_when_no_manga_found(): void
|
||||
public function testItReturnsEmptyMatchesWhenNoMangaFound(): void
|
||||
{
|
||||
// Given - no manga in database
|
||||
|
||||
@@ -48,8 +47,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'unknown-manga_vol1_ch1.cbz'
|
||||
]
|
||||
'filename' => 'unknown-manga_vol1_ch1.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -60,7 +59,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertCount(0, $data['matches']);
|
||||
}
|
||||
|
||||
public function test_it_returns_bad_request_when_filename_is_missing(): void
|
||||
public function testItReturnsBadRequestWhenFilenameIsMissing(): void
|
||||
{
|
||||
// When
|
||||
$client = static::createClient();
|
||||
@@ -70,7 +69,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertResponseStatusCodeSame(400);
|
||||
}
|
||||
|
||||
public function test_it_extracts_chapter_and_volume_correctly(): void
|
||||
public function testItExtractsChapterAndVolumeCorrectly(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('Attack on Titan', 'attack-on-titan');
|
||||
@@ -79,8 +78,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'attack-on-titan_vol32_ch130.cbz'
|
||||
]
|
||||
'filename' => 'attack-on-titan_vol32_ch130.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -90,7 +89,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertNotEmpty($data['matches']);
|
||||
}
|
||||
|
||||
public function test_it_handles_filename_with_only_volume(): void
|
||||
public function testItHandlesFilenameWithOnlyVolume(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('Naruto', 'naruto');
|
||||
@@ -99,8 +98,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'naruto_vol50.cbz'
|
||||
]
|
||||
'filename' => 'naruto_vol50.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -111,7 +110,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertEquals('Naruto', $data['matches'][0]['title']);
|
||||
}
|
||||
|
||||
public function test_it_handles_filename_with_only_chapter(): void
|
||||
public function testItHandlesFilenameWithOnlyChapter(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('Bleach', 'bleach');
|
||||
@@ -120,8 +119,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'bleach_ch200.cbz'
|
||||
]
|
||||
'filename' => 'bleach_ch200.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -132,7 +131,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertEquals('Bleach', $data['matches'][0]['title']);
|
||||
}
|
||||
|
||||
public function test_it_sorts_matches_by_score(): void
|
||||
public function testItSortsMatchesByScore(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('One Piece', 'one-piece');
|
||||
@@ -143,8 +142,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'one-piece_vol108_ch1094.cbz'
|
||||
]
|
||||
'filename' => 'one-piece_vol108_ch1094.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -158,13 +157,13 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertEquals('One Piece', $data['matches'][0]['title']);
|
||||
|
||||
// Vérifier que les scores sont triés par ordre décroissant
|
||||
$scores = array_map(fn($match) => $match['matchScore'], $data['matches']);
|
||||
$scores = array_map(fn ($match) => $match['matchScore'], $data['matches']);
|
||||
$sortedScores = $scores;
|
||||
rsort($sortedScores);
|
||||
$this->assertEquals($sortedScores, $scores);
|
||||
}
|
||||
|
||||
public function test_it_handles_alternative_slugs(): void
|
||||
public function testItHandlesAlternativeSlugs(): void
|
||||
{
|
||||
// Given
|
||||
$manga = $this->createManga('Shingeki no Kyojin', 'shingeki-no-kyojin');
|
||||
@@ -175,8 +174,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'attack-on-titan_vol1_ch1.cbz'
|
||||
]
|
||||
'filename' => 'attack-on-titan_vol1_ch1.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -189,7 +188,7 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$this->assertContains('attack-on-titan', $data['matches'][0]['alternativeSlugs']);
|
||||
}
|
||||
|
||||
public function test_it_provides_possible_titles_variants(): void
|
||||
public function testItProvidesPossibleTitlesVariants(): void
|
||||
{
|
||||
// Given
|
||||
$this->createManga('Dragon Ball', 'dragon-ball');
|
||||
@@ -198,8 +197,8 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
$client = static::createClient();
|
||||
$response = $client->request('GET', '/api/manga-matches', [
|
||||
'query' => [
|
||||
'filename' => 'dragon-ball_vol1_ch5.cbz'
|
||||
]
|
||||
'filename' => 'dragon-ball_vol1_ch5.cbz',
|
||||
],
|
||||
]);
|
||||
|
||||
// Then
|
||||
@@ -233,4 +232,3 @@ class FindMangaMatchByFilenameTest extends AbstractApiTestCase
|
||||
return $manga;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user