setAccessible(true); return $ref->invoke(null, $thesis); } // ── Basic output ────────────────────────────────────────────────────────── public function testBuildHtmlReturnsNonEmptyString(): void { $thesis = [ 'identifier' => '2024-001', 'title' => 'My Thesis', 'authors' => 'John Doe', 'year' => '2024', 'synopsis' => 'A brief synopsis.', 'keywords' => 'art, design', ]; $html = $this->buildHtml($thesis); $this->assertIsString($html); $this->assertNotEmpty($html); $this->assertStringContainsString('My Thesis', $html); $this->assertStringContainsString('2024-001', $html); $this->assertStringContainsString('John Doe', $html); } public function testBuildHtmlContainsKeyFields(): void { $thesis = [ 'title' => 'Test Title', 'authors' => 'Alice', 'year' => '2025', 'identifier' => '2025-042', 'orientation' => 'BD', ]; $html = $this->buildHtml($thesis); $this->assertStringContainsString('Test Title', $html); $this->assertStringContainsString('Alice', $html); $this->assertStringContainsString('2025', $html); $this->assertStringContainsString('2025-042', $html); $this->assertStringContainsString('BD', $html); } // ── HTML escaping ───────────────────────────────────────────────────────── public function testBuildHtmlEscapesSpecialCharacters(): void { $thesis = [ 'identifier' => '2024-999', 'title' => '', 'authors' => 'Evil & Co.', 'year' => '2024', ]; $html = $this->buildHtml($thesis); $this->assertStringNotContainsString('