Remove dead code and validate new polls only once
- Drop the unused polls.show_results_to_participants column (idempotent migration). - Remove CaptchaInterface::getType(), the unused AjaxView with its layout, the empty cell template folder and a redundant setNew() call. - PollsTable::newPoll() normalises and validates once; the create form used to validate the raw input first, so an e-mail address with surrounding spaces was rejected although it would have been trimmed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8b0e82d806
commit
121097f7a7
13 files changed
+78
-102
No files matched your search
@@ -70,6 +70,17 @@ class HomeControllerTest extends TestCase
|
||||
$this->assertResponseNotContains('/admin/', 'Admin link must not be shown when disabled');
|
||||
}
|
||||
|
||||
public function testCreateAcceptsEmailWithSurroundingSpaces(): void
|
||||
{
|
||||
$this->session(['Captcha.math.create' => 7]);
|
||||
$this->post('/create', ['title' => ' Retro ', 'email' => ' Owner@Example.org ', 'captcha_answer' => '7']);
|
||||
|
||||
$this->assertRedirect(['_name' => 'created']);
|
||||
$poll = $this->pollsTable()->find()->firstOrFail();
|
||||
$this->assertSame('Retro', $poll->title);
|
||||
$this->assertSame('owner@example.org', $poll->email);
|
||||
}
|
||||
|
||||
public function testIndexRendersHiddenHoneypot(): void
|
||||
{
|
||||
$this->get('/');
|
||||
|
||||
Reference in new issue
Block a user