summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-09-16 22:19:07 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-09-16 22:19:07 +0200
commitd3fdcf53bcaf4b143c316f3379190d0053a6036f (patch)
tree81c99de94b0359f95eb847292344ea0c5807f687 /tests
parent7e00fa32ea8262de0a98ff78fb5be1dc16204aea (diff)
downloadgigologadmin-d3fdcf53bcaf4b143c316f3379190d0053a6036f.tar.gz
gigologadmin-d3fdcf53bcaf4b143c316f3379190d0053a6036f.tar.bz2
gigologadmin-d3fdcf53bcaf4b143c316f3379190d0053a6036f.zip
Clean up, fix and rename db tables.
This patch got a bit more involved than what was originally planned, but since we're messing with the tables I decided to do it all right away. - Moves the constraint definition to the CREATE TABLE statement for the concerts table. This replaces the existing KEY definition that it had. - Make sure the venues table is created before the concerts table so that the above mentioned constraint definition works. - Rename the tables. Use the wpdb-prefix and make the name a bit prettier. This caused some changes in the Concert and Venue classes, and for slightly silly reasons some test classes. The code actually turned out better (for the most part), but some refactoring can still be done. The column names remains unchanged for now.
Diffstat (limited to 'tests')
-rw-r--r--tests/ConcertTest.php4
-rw-r--r--tests/ConcertsTableTest.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/ConcertTest.php b/tests/ConcertTest.php
index 4f27f0f..dc2a712 100644
--- a/tests/ConcertTest.php
+++ b/tests/ConcertTest.php
@@ -69,8 +69,8 @@ final class ConcertTest extends WP_UnitTestCase
global $wpdb;
$tables = [
- "wpg_concerts",
- "wpg_venues",
+ "{$wpdb->prefix}giglogadmin_concerts",
+ "{$wpdb->prefix}giglogadmin_venues",
];
foreach( $tables as $table ) {
diff --git a/tests/ConcertsTableTest.php b/tests/ConcertsTableTest.php
index 556698a..6f9d9d2 100644
--- a/tests/ConcertsTableTest.php
+++ b/tests/ConcertsTableTest.php
@@ -65,8 +65,8 @@ class ConcertsTableTest extends WP_UnitTestCase
global $wpdb;
$tables = [
- "wpg_concerts",
- "wpg_venues",
+ "{$wpdb->prefix}giglogadmin_concerts",
+ "{$wpdb->prefix}giglogadmin_venues",
];
foreach( $tables as $table ) {