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
@@ -28,7 +28,7 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
'scrapingType' => 'html',
|
||||
'imageSelector' => '.chapter-image img',
|
||||
'nextPageSelector' => '.next-page',
|
||||
'chapterSelector' => '.chapter-list a'
|
||||
'chapterSelector' => '.chapter-list a',
|
||||
],
|
||||
[
|
||||
'baseUrl' => 'https://mangakakalot.com',
|
||||
@@ -36,13 +36,13 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
'scrapingType' => 'javascript',
|
||||
'imageSelector' => '.page-image img',
|
||||
'nextPageSelector' => '.next-button',
|
||||
'chapterSelector' => '.chapter-link'
|
||||
]
|
||||
]
|
||||
'chapterSelector' => '.chapter-link',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => $importData
|
||||
'json' => $importData,
|
||||
]);
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
@@ -52,7 +52,7 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
$sources = $this->entityManager->getRepository(ContentSource::class)->findAll();
|
||||
$this->assertCount(2, $sources);
|
||||
|
||||
$baseUrls = array_map(fn($source) => $source->getBaseUrl(), $sources);
|
||||
$baseUrls = array_map(fn ($source) => $source->getBaseUrl(), $sources);
|
||||
$this->assertContains('https://mangadex.org', $baseUrls);
|
||||
$this->assertContains('https://mangakakalot.com', $baseUrls);
|
||||
}
|
||||
@@ -65,10 +65,10 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
[
|
||||
'baseUrl' => '',
|
||||
'chapterUrlFormat' => '',
|
||||
'scrapingType' => ''
|
||||
]
|
||||
]
|
||||
]
|
||||
'scrapingType' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_BAD_REQUEST);
|
||||
@@ -85,10 +85,10 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
'scrapingType' => 'html',
|
||||
'imageSelector' => '.image',
|
||||
'nextPageSelector' => '.next',
|
||||
'chapterSelector' => '.chapter'
|
||||
]
|
||||
]
|
||||
]
|
||||
'chapterSelector' => '.chapter',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_CREATED);
|
||||
@@ -105,10 +105,10 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
'scrapingType' => 'invalid-type',
|
||||
'imageSelector' => '.image',
|
||||
'nextPageSelector' => '.next',
|
||||
'chapterSelector' => '.chapter'
|
||||
]
|
||||
]
|
||||
]
|
||||
'chapterSelector' => '.chapter',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_CREATED);
|
||||
@@ -118,8 +118,8 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
{
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => [
|
||||
'contentSources' => 'not-an-array'
|
||||
]
|
||||
'contentSources' => 'not-an-array',
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_BAD_REQUEST);
|
||||
@@ -129,8 +129,8 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
{
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => [
|
||||
'contentSources' => []
|
||||
]
|
||||
'contentSources' => [],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_UNPROCESSABLE_ENTITY);
|
||||
@@ -140,8 +140,8 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
{
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => [
|
||||
'invalidField' => []
|
||||
]
|
||||
'invalidField' => [],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseStatusCodeSame(Response::HTTP_UNPROCESSABLE_ENTITY);
|
||||
@@ -157,13 +157,13 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
'scrapingType' => 'html',
|
||||
'imageSelector' => '.simple-image',
|
||||
'nextPageSelector' => '.simple-next',
|
||||
'chapterSelector' => '.simple-chapter'
|
||||
]
|
||||
]
|
||||
'chapterSelector' => '.simple-chapter',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => $importData
|
||||
'json' => $importData,
|
||||
]);
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
@@ -171,7 +171,7 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
|
||||
// Vérifier que la source a été créée
|
||||
$source = $this->entityManager->getRepository(ContentSource::class)->findOneBy([
|
||||
'baseUrl' => 'https://simple-source.com'
|
||||
'baseUrl' => 'https://simple-source.com',
|
||||
]);
|
||||
$this->assertNotNull($source);
|
||||
$this->assertEquals('html', $source->getScrapingType());
|
||||
@@ -183,21 +183,21 @@ final class ImportContentSourceTest extends AbstractApiTestCase
|
||||
public function testItHandlesLargeImport(): void
|
||||
{
|
||||
$contentSources = [];
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
for ($i = 1; $i <= 10; ++$i) {
|
||||
$contentSources[] = [
|
||||
'baseUrl' => "https://source{$i}.com",
|
||||
'chapterUrlFormat' => "https://source{$i}.com/chapter/{id}",
|
||||
'scrapingType' => 'html',
|
||||
'imageSelector' => ".source{$i}-image img",
|
||||
'nextPageSelector' => ".source{$i}-next",
|
||||
'chapterSelector' => ".source{$i}-chapter a"
|
||||
'chapterSelector' => ".source{$i}-chapter a",
|
||||
];
|
||||
}
|
||||
|
||||
$response = static::createClient()->request('POST', '/api/content-sources/import', [
|
||||
'json' => [
|
||||
'contentSources' => $contentSources
|
||||
]
|
||||
'contentSources' => $contentSources,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
|
||||
Reference in New Issue
Block a user