Bug #35007
Functional tests do not work with MySQL database
100%
Description
If persistence is enabled in functional tests and a MySQL database is configured, I get the following error when executing the test on a clean database:
1) Planetflow3\Tests\Functional\Controller\StandardControllerTest::indexActionWithoutParametersDisplaysRecentItems PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'persistence_testentity' already exists /Volumes/Data/Work/FLOW3/Planetflow3/Packages/Framework/Doctrine.DBAL/Classes/Connection.php:633 /Volumes/Data/Work/FLOW3/Planetflow3/Packages/Framework/Doctrine.ORM/Classes/Tools/SchemaTool.php:671 /Volumes/Data/Work/FLOW3/Planetflow3/Data/Temporary/Testing/Cache/Code/FLOW3_Object_Classes/TYPO3_FLOW3_Persistence_Doctrine_PersistenceManager_Original.php:271 /Volumes/Data/Work/FLOW3/Planetflow3/Packages/Framework/TYPO3.FLOW3/Tests/FunctionalTestCase.php:119 /Volumes/Data/Work/FLOW3/Planetflow3/Packages/Application/Planetflow3/Tests/Functional/Controller/StandardControllerTest.php:38 /Volumes/Data/Work/FLOW3/Planetflow3/Packages/Framework/TYPO3.FLOW3/Tests/BaseTestCase.php:49
Updated by Karsten Dambekalns almost 9 years ago
- Category set to - Testing -
- Status changed from New to Accepted
- Assignee set to Karsten Dambekalns
- Target version set to 1.1
I'll check this.
Updated by Karsten Dambekalns almost 9 years ago
- Status changed from Accepted to Needs Feedback
Works for me using a Phoenix setup. Are you sure in your test setup/teardown are called?
Updated by Christopher Hlubek over 8 years ago
This seems to be a problem with MySQL and lower / uppercase table names (maybe only on case insensitive filesystems).
We have to make sure that table names are handled consistently. When creating tables, they are spelled mixed-case (depending on table option). On tearDown the tables are dropped with lowercase.
Updated by Karsten Dambekalns over 8 years ago
I remember we talked about that during T3DD12 - i'll change the table annotation in the fixture and submit a change (or could you do that)?
That would be more of a hotfix - since setup and teardown just use Doctrine Schema tools, it should work the same in both ways, no? Doctrine bug?
Updated by Christopher Hlubek over 8 years ago
I tried to fix that, but it didn't work either (maybe my test database was already "corrupted"). I upgraded from MySQL 5.1.46 to 5.1.61 (Mac Ports) and don't get the problem anymore. But I still think that the annotation should be lowercase for consistency.
Updated by Gerrit Code Review over 8 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/10885
Updated by Karsten Dambekalns over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 019507ae40359ac87558d79178caf1267de21480.