diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-09-06 16:06:51 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-09-06 16:06:51 +0200 |
commit | fc842d4dd0d9af352640316601aaee398be8b636 (patch) | |
tree | 6cf1bfd273aa7ccfe8bdc7b9030028f29e29270e /tests/ConcertTest.php | |
parent | 1169022cdca0c27deb6fd0ddca96859c578a19b3 (diff) | |
download | gigologadmin-fc842d4dd0d9af352640316601aaee398be8b636.tar.gz gigologadmin-fc842d4dd0d9af352640316601aaee398be8b636.tar.bz2 gigologadmin-fc842d4dd0d9af352640316601aaee398be8b636.zip |
Use find_concerts to check for duplicates on create.
This also adds a number of new filters to find_concerts.
Diffstat (limited to 'tests/ConcertTest.php')
-rw-r--r-- | tests/ConcertTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php index d81effd..13df320 100644 --- a/tests/ConcertTest.php +++ b/tests/ConcertTest.php @@ -198,4 +198,20 @@ final class ConcertTest extends WP_UnitTestCase $gigs = GiglogAdmin_Concert::find_concerts(); $this->assertEquals(count(self::$concerts), count($gigs)); } + + public function testFetchConcertByNameVenueAndDate() : void + { + $gigs = GiglogAdmin_Concert::find_concerts([ + 'name' => 'a concert', + 'venue' => 'a venue', + 'date' => date('Y-m-d') + ]); + + $this->assertEquals(1, count($gigs)); + + $gig = array_shift($gigs); + $this->assertEquals('a concert', $gig->cname()); + $this->assertEquals('a venue', $gig->venue()->name()); + $this->assertEquals(date('Y-m-d'), $gig->cdate()); + } } |