summaryrefslogtreecommitdiffstats
path: root/tests/ConcertsTableTest.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2022-06-18 19:53:46 +0200
committerHarald Eilertsen <haraldei@anduin.net>2022-06-18 19:53:46 +0200
commit745ed40d46c18c683322b19939455deed52e94df (patch)
treea967df65a843d430630686cacaabfc87b50121c8 /tests/ConcertsTableTest.php
parent1fa1654de0527440d057c5ed05891bed6cc0b69c (diff)
downloadgigologadmin-745ed40d46c18c683322b19939455deed52e94df.tar.gz
gigologadmin-745ed40d46c18c683322b19939455deed52e94df.tar.bz2
gigologadmin-745ed40d46c18c683322b19939455deed52e94df.zip
Fix ConcertTable tests and markup.
Diffstat (limited to 'tests/ConcertsTableTest.php')
-rw-r--r--tests/ConcertsTableTest.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/ConcertsTableTest.php b/tests/ConcertsTableTest.php
index 6f9d9d2..f6ee3cd 100644
--- a/tests/ConcertsTableTest.php
+++ b/tests/ConcertsTableTest.php
@@ -34,7 +34,7 @@ class ConcertsTableTest extends WP_UnitTestCase
$created_venues[] = GiglogAdmin_Venue::find_or_create($venue[0], $venue[1]);
}
- $today = date("Y-m-d");
+ $today = new DateTime();
foreach (self::CONCERTS as $concert) {
for ($i = 0; $i < $concert[2]; $i++) {
@@ -45,10 +45,13 @@ class ConcertsTableTest extends WP_UnitTestCase
$concert_name = $concert[0];
}
+ $offset = rand(1, 13);
+ $concert_date = $today->modify( "+$offset days" );
+
self::$concerts[] = GiglogAdmin_Concert::create(
$concert_name,
$created_venues[$concert[1]]->id(),
- $today,
+ $concert_date->format( 'Y-m-d' ),
"https://example.com/tickets/42",
"https://example.com/events/93");
}
@@ -104,8 +107,8 @@ class ConcertsTableTest extends WP_UnitTestCase
}
}
- $this->assertEquals(64, $assignit_count); // four for each gig
- $this->assertEquals(16, $adminactions_count); // once for each gig
+ $this->assertEquals(60, $assignit_count); // four for each gig
+ $this->assertEquals(15, $adminactions_count); // once for each gig
}
function testDontShowAdminOnlyControlsToNonAdminsOnAdminPage() {
@@ -138,7 +141,7 @@ class ConcertsTableTest extends WP_UnitTestCase
}
}
- $this->assertEquals(64, $assignit_count); // four for each gig
+ $this->assertEquals(60, $assignit_count); // four for each gig
$this->assertEquals(0, $adminactions_count); // once for each gig
}