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

@@ -256,6 +256,8 @@ class ThesisEditController
'synopsis' => trim($post['synopsis'] ?? ''),
'context_note' => trim($post['context_note'] ?? ''),
'file_size_info' => $this->buildFileSizeInfo($post),
'duration_pages' => trim($post['duration_pages'] ?? ''),
'duration_minutes'=> trim($post['duration_minutes'] ?? ''),
'baiu_link' => trim($post['lien'] ?? ''),
'license_id' => filter_var($post['license_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
'access_type_id' => filter_var($post['access_type_id'] ?? '', FILTER_VALIDATE_INT) ?: null,
@@ -291,12 +293,18 @@ class ThesisEditController
$this->db->setThesisJury($thesisId, $juryMembers);
// ── 4. Languages ──────────────────────────────────────────────────
$this->db->setThesisLanguages(
$thesisId,
isset($post['languages']) && is_array($post['languages'])
? $post['languages']
: []
);
$langIds = isset($post['languages']) && is_array($post['languages'])
? $post['languages']
: [];
$autreRaw = trim($post['language_autre'] ?? '');
if ($autreRaw !== '') {
foreach (array_map('trim', explode(',', $autreRaw)) as $langName) {
if ($langName !== '') {
$langIds[] = (string)$this->db->getOrCreateLanguage($langName);
}
}
}
$this->db->setThesisLanguages($thesisId, $langIds);
// ── 5. Formats ────────────────────────────────────────────────────
$this->db->setThesisFormats(
@@ -710,7 +718,7 @@ class ThesisEditController
/**
* Build file_size_info from separate duration fields.
*/
private function buildFileSizeInfo(array $post): string
protected function buildFileSizeInfo(array $post): string
{
$pages = trim($post['duration_pages'] ?? '');
$minutes = trim($post['duration_minutes'] ?? '');