From 97eedd793237dc45d44409013e45696bcb772721 Mon Sep 17 00:00:00 2001 From: AndreaChirulescu Date: Sat, 24 Apr 2021 20:42:43 +0200 Subject: added venue test to check duplicate with all letter cases CSS for edit form in giglog --- includes/admin/views/giglog_admin_page.php | 34 ++++++++++++++++-------------- includes/css/main.css | 34 ++++++++++++++++++++++++++++++ tests/VenueTest.php | 11 ++++++++++ 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/includes/admin/views/giglog_admin_page.php b/includes/admin/views/giglog_admin_page.php index 870e361..3336fbd 100644 --- a/includes/admin/views/giglog_admin_page.php +++ b/includes/admin/views/giglog_admin_page.php @@ -134,34 +134,36 @@ if ( !class_exists( 'GiglogAdmin_AdminPage' ) ) { else $c = new GiglogAdmin_Concert(); - $content='
Form to create/edit concerts and venues
' + $content='

Form to create/edit concerts and venues


'; + $content.='' + .'
CONCERT DETAILS

' .'' - .'
' + .'
' .''.GiglogAdmin_AdminPage::get_allvenues($c->venue()).'
' .'
' .'
' .'
' - .''.GiglogAdmin_AdminPage::get_user($c->id(),'photo1').'
' - .''.GiglogAdmin_AdminPage::get_user($c->id(),'photo2').'
' - .''.GiglogAdmin_AdminPage::get_user($c->id(),'rev1').'
' - .''.GiglogAdmin_AdminPage::get_user($c->id(),'rev2').'
' - ; - + .'
'; // actions differ if we update or create a concert, hence two buttons needed - if ($editing) { + if ($editing) $content.='

'; - } - else { + else $content.='

'; - } - $content.=''; + $content.='
'; + $content.='
ASSIGNMENT DETAILS

' + .''.GiglogAdmin_AdminPage::get_user($c->id(),'photo1').'
' + .''.GiglogAdmin_AdminPage::get_user($c->id(),'photo2').'
' + .''.GiglogAdmin_AdminPage::get_user($c->id(),'rev1').'
' + .''.GiglogAdmin_AdminPage::get_user($c->id(),'rev2').'
'; - $content.='

' - .'
' + $content.='
'; + $content.='
VENUE DETAILS

' + .'

' .'
' .'

' - .''; + .'
'; + $content.='
'; return $content; } diff --git a/includes/css/main.css b/includes/css/main.css index 27ecbef..3d26183 100644 --- a/includes/css/main.css +++ b/includes/css/main.css @@ -102,3 +102,37 @@ input[name="unassignitem"] padding: unset; width: 80px; } + +/*for giglog editform*/ +.editform input,textarea +{ + box-shadow:10px; + border-radius:10px; +} + +.editform, .concert +{ + display:flex; +} + +.concertform,.venueform +{ + padding: 2px; + border: 1px solid; +} + + .editform fieldset { + min-width: 200px; + display: inline-block; + } + + .editform fieldset label{ + margin-right: 10px; + position: relative; + display: block; + } + + .editform textarea + { + height: auto; + } diff --git a/tests/VenueTest.php b/tests/VenueTest.php index 4278951..1fde15e 100644 --- a/tests/VenueTest.php +++ b/tests/VenueTest.php @@ -41,6 +41,17 @@ final class VenueTest extends WP_UnitTestCase $this->assertEquals($other->name(), $venue->name()); } + public function testFindOrCreateExistingVenueVariableCase() : void + { + global $wpdb; + + $venue = GiglogAdmin_Venue::create("This is not the venue you are looking for"); + $other = GiglogAdmin_Venue::find_or_create("ThiS IS noT tHe VenuE YOu aRe looking FoR"); + + $this->assertEquals($other->id(), $venue->id()); + $this->assertEquals($other->name(), $venue->name()); + } + public function testFindAllVenuesInCity() : void { global $wpdb; -- cgit v1.2.3