summaryrefslogtreecommitdiffstats
path: root/tests/ConcertTest.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-01 22:01:42 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-01 22:01:42 +0200
commitfb8d2649e17c94458db247925b796f5ae2141b0d (patch)
tree28d7d9e9bc9cc68e715192cc6a4d1fb07900c863 /tests/ConcertTest.php
parent224f0149ea513146b164736f461e6cbba4b86add (diff)
downloadgigologadmin-fb8d2649e17c94458db247925b796f5ae2141b0d.tar.gz
gigologadmin-fb8d2649e17c94458db247925b796f5ae2141b0d.tar.bz2
gigologadmin-fb8d2649e17c94458db247925b796f5ae2141b0d.zip
Fix saving and fetching roles from Concerts table.
Diffstat (limited to 'tests/ConcertTest.php')
-rw-r--r--tests/ConcertTest.php23
1 files changed, 4 insertions, 19 deletions
diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php
index 0bf345c..5e6ebde 100644
--- a/tests/ConcertTest.php
+++ b/tests/ConcertTest.php
@@ -135,27 +135,12 @@ final class ConcertTest extends WP_UnitTestCase
public function testAssignConcertRoles() : 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");
-
- $gig->assign_role( GiglogAdmin_Roles::PHOTO1, 'user1' );
- $this->assertEquals( [ GiglogAdmin_Roles::PHOTO1 => 'user1' ], $gig->roles() );
-
+ $gig = GiglogAdmin_Concert::get(self::$concerts[0]->id());
+ $gig->assign_role( 'photo1' , 'user1' );
$gig->save();
- var_dump($gig);
-
- $fetched_gig = GiglogAdmin_Concert::get( $gig->id() );
- global $wpdb;
- $wpdb->print_error();
- $this->assertEquals( [ GiglogAdmin_Roles::PHOTO1 => 'user1' ], $fetched_gig->roles() );
+ $fetched_gig = GiglogAdmin_Concert::get( self::$concerts[0]->id() );
+ $this->assertEquals( [ 'photo1' => 'user1' ], $fetched_gig->roles() );
}
public function testOnlyFetchConcertsFromGivenCity() : void