Originally reported by: Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann)
PHPUnit tests using DB_fixture.php do not work due to insufficient permissions on the coratest.* tables:
PHPUnit_Extensions_Database_Operation_Exception: COMPOSITE[TRUNCATE] operation failed on query:
TRUNCATE `tag_suggestion`
using args: Array
(
)
[SQLSTATE[42000]: Syntax error or access violation: 1142 DROP command denied to user 'cora'@'localhost' for table 'tag_suggestion']
I believe this is a result of PHPUnit trying to recreate the provided XML dataset tests/DB_fixture.php:39 in the database, since
it uses getConnection() for that, which returns a connection with the cora user; and
the exception happens at the parent::setUp() call for each and every test case that uses DB_fixture.php.
I believe this went unnoticed for a very long time because we used to grant "all" privileges to cora for coratest.*, and these permissions were still stored on all development machines after the change was made.
Originally reported by: Marcel Bollmann (Bitbucket: mbollmann, GitHub: mbollmann)
PHPUnit tests using DB_fixture.php do not work due to insufficient permissions on the
coratest.*
tables:I believe this is a result of PHPUnit trying to recreate the provided XML dataset tests/DB_fixture.php:39 in the database, since
getConnection()
for that, which returns a connection with thecora
user; andparent::setUp()
call for each and every test case that uses DB_fixture.php.I believe this went unnoticed for a very long time because we used to grant "all" privileges to
cora
forcoratest.*
, and these permissions were still stored on all development machines after the change was made.