From 745ed40d46c18c683322b19939455deed52e94df Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 18 Jun 2022 19:53:46 +0200 Subject: Fix ConcertTable tests and markup. --- includes/admin/views/_concerts_table.php | 8 +++----- tests/ConcertsTableTest.php | 13 ++++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php index ad7aebc..4f9b3c9 100644 --- a/includes/admin/views/_concerts_table.php +++ b/includes/admin/views/_concerts_table.php @@ -310,7 +310,7 @@ if ( ! class_exists( 'GiglogAdmin_ConcertsTable' ) ) { $content .= 'Tickets'; } - $content .= ' iCal'; + $content .= 'iCal'; $content .= ''; $last_city = $concert->venue()->city(); } @@ -320,7 +320,7 @@ if ( ! class_exists( 'GiglogAdmin_ConcertsTable' ) ) { $content .= $this->render_pagination(); // from main form that includes filters - $content .= '

'; + $content .= ''; // return the table return $content; @@ -329,7 +329,7 @@ if ( ! class_exists( 'GiglogAdmin_ConcertsTable' ) ) { private function render_filters() : string { global $wp_locale; - $select = '

FILTER DATA: '; + $select = 'FILTER DATA: '; foreach ( $_GET as $name => $val ) { if ( in_array( $name, self::FILTER_KEYS ) ) { @@ -372,8 +372,6 @@ if ( ! class_exists( 'GiglogAdmin_ConcertsTable' ) ) { 'Select month...' ); - $select .= ''; - if ( is_admin() ) { // option to select own concerts only $select .= '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 } -- cgit v1.2.3