From ae72f1b2f0c73ded5277300f0d15914e6e10ecae Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 10 May 2021 10:45:04 +0200 Subject: Make it possible to list all concerts. --- tests/ConcertTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests') diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php index 96fc72b..ec7bc13 100644 --- a/tests/ConcertTest.php +++ b/tests/ConcertTest.php @@ -168,4 +168,27 @@ final class ConcertTest extends WP_UnitTestCase $this->assertEquals("Revolver", $gig->venue()->name()); } } + + public function testFetchAllConcerts() : void + { + $venue1 = GiglogAdmin_Venue::create("Svene Bedehus", "Svene"); + $venue2 = GiglogAdmin_Venue::create("Rockefeller Music Hall", "Oslo"); + $venue3 = GiglogAdmin_Venue::create("Meieriet", "Sogndal"); + + for ($i = 0; $i < 4; $i++) { + GiglogAdmin_Concert::create('Concert ' . $i, $venue1->id(), '', '', ''); + } + + for ($i = 4; $i < 6; $i++) { + GiglogAdmin_Concert::create('Concert ' . $i, $venue2->id(), '', '', ''); + } + + for ($i = 6; $i < 11; $i++) { + GiglogAdmin_Concert::create('Concert ' . $i, $venue3->id(), '', '', ''); + } + + $gigs = GiglogAdmin_Concert::find_concerts_in(); + + $this->assertEquals(11, count($gigs)); + } } -- cgit v1.2.3