Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
silasary committed Nov 1, 2023
1 parent 9a7d178 commit c75e571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion gatherling/models/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ public function getEntries()
*
* @return Entry[]
*/
public function getRegisteredEntries($deleteinvalid = false)
public function getRegisteredEntries($deleteinvalid = false, $skip_invalid = false)
{
$players = $this->getPlayers();

Expand All @@ -692,6 +692,9 @@ public function getRegisteredEntries($deleteinvalid = false)
$entry->removeEntry($player);
continue;
}
if ($skip_invalid) {
continue;
}
}
$entries[] = $entry;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testRegistration($event)
// 8 players have expressed interest in the event.
$this->assertEquals(10, count($event->getEntries()));
// No players have filled out decklists.
$this->assertEquals(0, count($event->getRegisteredEntries()));
$this->assertEquals(0, count($event->getRegisteredEntries(false, true)));

$deck = insertDeck('testplayer0', $event, '60 Plains', '');
$this->assertEmpty($deck->errors, json_encode($deck->errors));
Expand All @@ -131,7 +131,7 @@ public function testRegistration($event)
$deck = insertDeck('testplayer7', $event, "55 Mountain\n5 Seven Dwarves", '5 Seven Dwarves');
$this->assertNotEmpty($deck->errors, json_encode($deck->errors), 'Too Many Dwarves');
// 5 Valid decks (0, 1, 2, and 4, 5), 3 invalid deck (3, 6, 7), and 3 not submitted decks.
$this->assertEquals(5, count($event->getRegisteredEntries()));
$this->assertEquals(5, count($event->getRegisteredEntries(false, true)));

return $event;
}
Expand Down

0 comments on commit c75e571

Please sign in to comment.