summaryrefslogtreecommitdiffstats
path: root/tests/ConcertTest.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-06-14 10:07:55 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-06-14 10:07:55 +0200
commit82c4a8f2c4e5acd80b813829cecc40f621da3b21 (patch)
tree6ea5d9a65eaaa616598072e91b7a7479406b8954 /tests/ConcertTest.php
parent68652c0546845de2f216d7fb285205e2eddf9d41 (diff)
downloadgigologadmin-82c4a8f2c4e5acd80b813829cecc40f621da3b21.tar.gz
gigologadmin-82c4a8f2c4e5acd80b813829cecc40f621da3b21.tar.bz2
gigologadmin-82c4a8f2c4e5acd80b813829cecc40f621da3b21.zip
Begin move roles and status field to concerts table.
There's no need to have a separate table (concertlogs) for these fields.
Diffstat (limited to 'tests/ConcertTest.php')
-rw-r--r--tests/ConcertTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php
index 2c747b8..7edda46 100644
--- a/tests/ConcertTest.php
+++ b/tests/ConcertTest.php
@@ -86,6 +86,30 @@ final class ConcertTest extends WP_UnitTestCase
$this->assertEquals($gig->id(), $fetched_gig->id());
$this->assertEquals($gig->cname(), $fetched_gig->cname());
$this->assertEquals($venue->id(), $fetched_gig->venue()->id());
+ $this->assertEquals(GiglogAdmin_Concert::STATUS_NONE, $fetched_gig->status());
+ $this->assertEquals([], $fetched_gig->roles());
+ }
+
+ public function testSetConcertStatus() : 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());
+ $fetched_gig->set_status( GiglogAdmin_Concert::STATUS_ACCRED_REQ );
+ $this->assertEquals( GiglogAdmin_Concert::STATUS_ACCRED_REQ, $fetched_gig->status() );
+
+ $fetched_gig->save();
+
+ $fetched_gig_2 = GiglogAdmin_Concert::get($gig->id());
+ $this->assertEquals( GiglogAdmin_Concert::STATUS_ACCRED_REQ, $fetched_gig_2->status() );
}
public function testOnlyFetchConcertsFromGivenCity() : void