diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-09-11 11:56:36 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-09-11 11:56:36 +0200 |
commit | aefe55a70d6f6bae7825f3a1a6b61046c8ec2cc3 (patch) | |
tree | 9f1b98e73d2e6f0fcc4f49b2cd581a9e1d8a7338 /includes/admin/views/_concerts_table.php | |
parent | 0496d664f66c68cc56f68562129672a39cf09416 (diff) | |
download | gigologadmin-aefe55a70d6f6bae7825f3a1a6b61046c8ec2cc3.tar.gz gigologadmin-aefe55a70d6f6bae7825f3a1a6b61046c8ec2cc3.tar.bz2 gigologadmin-aefe55a70d6f6bae7825f3a1a6b61046c8ec2cc3.zip |
tests: Make an actual test for ConcertsTable
There's a bit of setup to make this work as it should, we need to ensure
that the current user and current screen is set to proper values so that
the WordPress api's `is_admin()` and `current_user_can()` work as they
should.
This first test just tests that all the expected forms are being
rendered for the admin user accessing the table through the site admin
interface.
Diffstat (limited to 'includes/admin/views/_concerts_table.php')
-rw-r--r-- | includes/admin/views/_concerts_table.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/admin/views/_concerts_table.php b/includes/admin/views/_concerts_table.php index 25bbef7..9c895de 100644 --- a/includes/admin/views/_concerts_table.php +++ b/includes/admin/views/_concerts_table.php @@ -157,7 +157,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) private function adminactions( GiglogAdmin_Concert $concert ) : string { return - '<form method="POST" action="">' + '<form class="adminactions" method="POST" action="">' . '<input type="hidden" name="cid" value="' . $concert->id() . '" />' . \EternalTerror\ViewHelpers\select_field( 'selectstatus', @@ -193,7 +193,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) //first check if current slot is taken by current user if ( $assigned_user == $this->username ) { - $f = '<form class="unassignit" method="POST" action="">' + $f = '<form class="unassign_concert" method="POST" action="">' . ' <input type="hidden" name="cid" value="' . $concert->id() . '" />' . ' <input type="hidden" name="pid" value="' . $role . '" />' . ' <input type="submit" name="unassignitem" value=""/>' @@ -208,7 +208,7 @@ if (!class_exists("GiglogAdmin_ConcertsTable")) $f = '<span class="taken_by_self">-</span>'; } else { //not taken by anyone - $f = '<form method="POST" action="">' + $f = '<form class="assign_concert" method="POST" action="">' . ' <input type="hidden" name="cid" value="' . $concert->id() . '" />' . ' <input type="hidden" name="pid" value="' . $role. '" />' . ' <input type="submit" name="assignitem" value=""/>' |