Share repeated controller and service code
CI / Deploy / test (push) Successful in 53s
CI / Deploy / deploy (push) Skipped

- AppController: joinUrl(), adminUrlFor(), setPollInterval() and protect()
  instead of copies in Admin-, Home-, Participate- and EmbedController.
- PollMailer::sendSafely() replaces two try/catch blocks around mail sending.
- Slide::optionIds() replaces five identical array_map() calls.
- PollStateService: one pollPayload() for presenter and embed; the vote
  action passes the already loaded slide instead of loading it again.
- ResultsService::forSlide() takes the answer/comment limit and the rating
  flag, so ReportService no longer queries answers, comments and the scale
  distribution twice and the export loads the slides only once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 22:50:56 +01:00
1 parent ad537b9b34
commit 3e44ded107
14 files changed
+189 -137

No files matched your search

@@ -243,5 +243,27 @@ class ScaleCommentsTest extends TestCase
$this->assertStringContainsString('2 Kommentare', $html);
$this->assertStringContainsString('Sehr &lt;gut&gt;', $html);
$this->assertStringNotContainsString('Bewertung 4', $html, 'ratings only with comment_ratings');
}
public function testInternalFlagDoesNotRevealRatingsWithoutPrivateSlides(): void
{
[, $token] = $this->scaleWithComments();
$html = $this->exportHtml($token, true);
$this->assertStringContainsString('Sehr &lt;gut&gt;', $html);
$this->assertStringNotContainsString('Bewertung 4', $html);
$this->assertStringNotContainsString('-intern', (string)$this->_response->getHeaderLine('Content-Disposition'));
}
public function testCompleteExportShowsRatingsOfAllScales(): void
{
[$poll, $token] = $this->scaleWithComments();
$this->createSlide($poll, Slide::TYPE_OPEN, ['settings' => ['private' => true]]);
$html = $this->exportHtml($token, true);
$this->assertStringContainsString('Bewertung 4', $html);
}
}