I’m writing unit tests for my CakePHP application. They currently run really slowly as my tables get dropped and recreated before every single test. I want to disable this behaviour, and instead have it so that fixtures are executed once per TestCase. Apparently it’s possible via $dropTables: http://stackoverflow.com/questions/21198435/cakephp-phpunit-fixtures-drop-database-table-every-time
But no matter what I set dropTables to, fixtures are still loaded/unloaded between each test run, which means my tests still run excruciatingly slowly. (30 seconds per test, and I have a few hundred tests already)
If I disable $autoFixtures then CakePHP skips running my fixtures, but it doesn’t run them at all. I need my fixtures to be run once at the start and end of every TestCase.
I thought about using setUpBeforeClass and setUpAfterClass to change the value of $autoFixtures on the fly or even to manually run my fixtures, but these functions have to be static and so I don’t think they have access to fixtureManager.
Help would be very much appreciated.