test: add ShareLinkTest + PureLogicTest (TDD), fix coverMap undefined in SearchController

This commit is contained in:
Pontoporeia
2026-05-08 10:56:27 +02:00
parent 15d54fa19e
commit 6ba13e00ea
16 changed files with 1274 additions and 68 deletions

View File

@@ -141,7 +141,7 @@ class TfeController
/**
* Build a ~160-character meta description from the thesis synopsis.
*/
private function buildMetaDescription(string $synopsis): string
protected function buildMetaDescription(string $synopsis): string
{
$plain = strip_tags($synopsis);
@@ -159,7 +159,7 @@ class TfeController
*
* @param array<int, array<string, mixed>> $files
*/
private function resolveOgImage(array $files): string
protected function resolveOgImage(array $files): string
{
// Prefer the dedicated cover
foreach ($files as $file) {
@@ -185,7 +185,7 @@ class TfeController
* @param array<string, mixed> $data
* @return array<string, string>
*/
private function buildOgTags(array $data, int $thesisId, string $metaDescription): array
protected function buildOgTags(array $data, int $thesisId, string $metaDescription): array
{
$ogImage = $this->resolveOgImage($data['files'] ?? []);
$title = $data['title'] . (!empty($data['authors']) ? ' ' . $data['authors'] : '');
@@ -210,7 +210,7 @@ class TfeController
* @param array<int, array<string, mixed>> $jury
* @return array{presidents: list<string>, internes: list<string>, externes: list<string>, ulb: list<string>, lecteurs_internes: list<string>, lecteurs_externes: list<string>}
*/
private function splitJuryByRole(array $jury): array
protected function splitJuryByRole(array $jury): array
{
$result = ['presidents' => [], 'internes' => [], 'externes' => [], 'ulb' => [], 'lecteurs_internes' => [], 'lecteurs_externes' => []];
@@ -253,7 +253,7 @@ class TfeController
* @param array<int, array<string, mixed>> $files
* @return list<string>
*/
private function collectCaptionPaths(array $files): array
protected function collectCaptionPaths(array $files): array
{
$captions = [];