diff options
author | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-05-09 21:58:23 +0200 |
---|---|---|
committer | AndreaChirulescu <andrea.chirulescu@gmail.com> | 2021-05-09 21:58:23 +0200 |
commit | 11570d3e87707396674bdf5179df48c641bb154d (patch) | |
tree | 5c4677689569dbece70de222d1869b4049698f6d /tests | |
parent | cfc0341c66e5c24ee4c1b8a8e53afac99587244b (diff) | |
parent | 142ff436282844677b8b4e7d8ececd44440ec96d (diff) | |
download | gigologadmin-11570d3e87707396674bdf5179df48c641bb154d.tar.gz gigologadmin-11570d3e87707396674bdf5179df48c641bb154d.tar.bz2 gigologadmin-11570d3e87707396674bdf5179df48c641bb154d.zip |
Tried to fix the psalm local changes done when I manually installed it
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ConcertTest.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php index 6d14b68..0517ad8 100644 --- a/tests/ConcertTest.php +++ b/tests/ConcertTest.php @@ -19,7 +19,7 @@ final class ConcertTest extends WP_UnitTestCase "https://example.com/events/93"); $this->assertEquals("a concert", $concert->cname()); - $this->assertEquals($venue->id(), $concert->venue()); + $this->assertEquals($venue->id(), $concert->venue()->id()); $this->assertEquals($today, $concert->cdate()); $this->assertEquals("https://example.com/tickets/42", $concert->tickets()); $this->assertEquals("https://example.com/events/93", $concert->eventlink()); @@ -68,4 +68,23 @@ final class ConcertTest extends WP_UnitTestCase $this->assertNull($new); } + + public function testGetConcertByIdReturnsFullConcertObject() : void + { + $venue = GiglogAdmin_Venue::create("a venue"); + $today = date("Y-m-d"); + + $gig = GiglogAdmin_Concert::create( + "a concert123", + $venue->id(), + $today, + "https://example.com/tickets/42", + "https://example.com/events/93"); + + $fetched_gig = GiglogAdmin_Concert::get($gig->id()); + + $this->assertEquals($gig->id(), $fetched_gig->id()); + $this->assertEquals($gig->cname(), $fetched_gig->cname()); + $this->assertEquals($venue->id(), $fetched_gig->venue()->id()); + } } |