summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ConcertTest.php21
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());
+ }
}