Revert "Browse and delete polls from a numbered list in the polls menu"
CI / Deploy / PHP 8.5 (push) Successful in 1m7s
CI / Deploy / PHP 8.4 (push) Successful in 1m11s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped

This reverts commit 7b83cf2f2c.
This commit is contained in:
gnilebein committed 2026-11-16 13:52:02 +01:00
1 parent bd401ed94a
commit e3f74e375f
6 files changed
+39 -202

No files matched your search

+2 -38
View File
@@ -127,10 +127,9 @@ class PollsCommandsTest extends TestCase
public function testMenuListsAndOpensPollWithLink(): void
{
[, $token] = $this->createPoll('Menü-Umfrage', 'menu@example.org');
[$poll, $token] = $this->createPoll('Menü-Umfrage', 'menu@example.org');
// Menu 1 (list), open row 1, show the link, back, leave the list, quit.
$this->exec('polls', ['1', '1', '2', '0', '', '0']);
$this->exec('polls', ['1', '4', (string)$poll->id, '2', '0', '0']);
$this->assertExitSuccess();
$this->assertOutputContains('menu@example.org');
$this->assertOutputContains('https://plenario.test/admin/' . $token);
@@ -151,41 +150,6 @@ class PollsCommandsTest extends TestCase
$this->assertSame(0, $this->pollsTable()->find()->where(['id' => $poll->id])->count());
}
public function testMenuListDeletesByNumber(): void
{
[$a] = $this->createPoll('Eins', 'eins@example.org');
[$b] = $this->createPoll('Zwei', 'zwei@example.org');
[$c] = $this->createPoll('Drei', 'drei@example.org');
// Unknown number and cancelled confirmation delete nothing.
$this->exec('polls', ['1', 'd 9', 'd 1', 'n', '', '0']);
$this->assertErrorContains('Nummer 9 gibt es nicht');
$this->assertSame(3, $this->pollsTable()->find()->count());
// Several at once with one confirmation.
$this->exec('polls', ['1', 'd 1,3', 'y', '', '0']);
$this->assertExitSuccess();
$this->assertEquals([$b->id], $this->pollsTable()->find()->all()->extract('id')->toList());
// Last one gone: the empty list returns to the menu by itself.
$this->exec('polls', ['1', 'd1', 'y', '0']);
$this->assertSame(0, $this->pollsTable()->find()->count());
$this->assertNotEmpty($a->id . $c->id);
}
public function testMenuListPagesThroughManyPolls(): void
{
for ($i = 1; $i <= 16; $i++) {
$this->createPoll('Umfrage ' . $i, 'p' . $i . '@example.org');
}
$this->exec('polls', ['1', 'n', 'p', '', '0']);
$this->assertExitSuccess();
$this->assertOutputContains('Seite 1 von 2');
$this->assertOutputContains('Seite 2 von 2');
$this->assertOutputContains('p16@example.org');
}
public function testMenuCleanupAsksBeforeDeleting(): void
{
[$old] = $this->createPoll();