Revert "Browse and delete polls from a numbered list in the polls menu"
This reverts commit 7b83cf2f2c.
This commit is contained in:
6 files changed
+39
-202
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user