From a9635eb7b3bc5d6bafe3966371cc8e057c906c55 Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Sun, 29 Oct 2023 15:36:23 +1100 Subject: [PATCH] A whole bunch of PHPDocs --- gatherling/api_lib.php | 5 +++++ tests/EventsTest.php | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 98492eb33..8d0adbb0e 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -447,6 +447,11 @@ function card_catalog() return $result; } +/** + * @param string $id + * @return string + * @throws Exception + */ function cardname_from_id($id) { $sql = 'SELECT c.name as name FROM cards c WHERE c.scryfallId = ?'; diff --git a/tests/EventsTest.php b/tests/EventsTest.php index 1494941f8..fb0bc0a08 100644 --- a/tests/EventsTest.php +++ b/tests/EventsTest.php @@ -8,10 +8,17 @@ use Gatherling\Event; use Gatherling\Matchup; use Gatherling\Series; +use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; +use SebastianBergmann\RecursionContext\InvalidArgumentException; final class EventsTest extends TestCase { + /** + * @return Series + * @throws InvalidArgumentException + * @throws ExpectationFailedException + */ public function testSeriesCreation() { if (!Series::exists('Test')) { @@ -30,6 +37,11 @@ public function testSeriesCreation() } /** + * @param Series $series + * @return Event + * @throws Exception + * @throws InvalidArgumentException + * @throws ExpectationFailedException * @depends testSeriesCreation */ public function testEventCreation($series) @@ -78,6 +90,11 @@ public function testEventCreation($series) } /** + * @param Event $event + * @return Event + * @throws InvalidArgumentException + * @throws ExpectationFailedException + * @throws Exception * @depends testEventCreation */ public function testRegistration($event) @@ -113,6 +130,10 @@ public function testRegistration($event) } /** + * @param Event $event + * @return Event + * @throws InvalidArgumentException + * @throws ExpectationFailedException * @depends testRegistration */ public function testEventStart($event) @@ -120,7 +141,7 @@ public function testEventStart($event) $this->assertEquals($event->active, 0); $this->assertEquals($event->current_round, 0); - $event->startEvent(); + $event->startEvent(True); $event = new Event($event->name); $this->assertEquals($event->active, 1); @@ -130,6 +151,10 @@ public function testEventStart($event) } /** + * @param Event $event + * @return mixed + * @throws InvalidArgumentException + * @throws ExpectationFailedException * @depends testEventStart */ public function testReporting($event) @@ -151,6 +176,14 @@ public function testReporting($event) } } +/** + * @param string $player + * @param Event $event + * @param string $main + * @param string $side + * @return Deck + * @throws Exception + */ function insertDeck($player, $event, $main, $side) { $deck = new Deck(0);