summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-05-10 10:45:04 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-05-10 10:45:04 +0200
commitae72f1b2f0c73ded5277300f0d15914e6e10ecae (patch)
treeacda885c4785fec568a4a01a32e308034600ebce /tests
parent61c48191a8e9ab757be4bf845072f4cfdbf9075f (diff)
downloadgigologadmin-ae72f1b2f0c73ded5277300f0d15914e6e10ecae.tar.gz
gigologadmin-ae72f1b2f0c73ded5277300f0d15914e6e10ecae.tar.bz2
gigologadmin-ae72f1b2f0c73ded5277300f0d15914e6e10ecae.zip
Make it possible to list all concerts.
Diffstat (limited to 'tests')
-rw-r--r--tests/ConcertTest.php23
1 files changed, 23 insertions, 0 deletions
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));
+ }
}