Skip to content

Commit ada6fd3

Browse files
committed
Tests: only delete test tables when generating the test database
Allows multiple Q2A instances in one database.
1 parent c41f2cd commit ada6fd3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

qa-tests/Q2A_TestsSetup.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ private function recreateTables()
114114
qa_db_query_sub(
115115
'SELECT GROUP_CONCAT("`", table_name, "`") INTO @tables ' .
116116
'FROM information_schema.tables ' .
117-
'WHERE table_schema = (SELECT DATABASE())'
117+
'WHERE table_schema = (SELECT DATABASE()) ' .
118+
'AND table_name LIKE "' . QA_MYSQL_TABLE_PREFIX . '%"'
118119
);
119120
qa_db_query_sub('SELECT IFNULL(@tables, "dummy") INTO @tables');
120121

qa-tests/phpunit-qa-config-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
define('QA_MYSQL_PASSWORD', 'your-test-mysql-password');
88
define('QA_MYSQL_DATABASE', 'your-test-mysql-db-name');
99

10-
define('QA_MYSQL_TABLE_PREFIX', 'qa_');
10+
define('QA_MYSQL_TABLE_PREFIX', 'qa_test_');
1111
define('QA_EXTERNAL_USERS', false);

0 commit comments

Comments
 (0)