CakePHP fixtures exporter for phpMyAdmin

One of the best features in CakePHP is it's testsuite. I now use it all the time, it takes some time to some time to setup initially, but once it's working the payoff is massive.

One of the most time consuming is setting up test fixtures, these define the table schema and data used for testing. Now you don't have to use this feature, without fixtures, tests simple use the real tables, however I think that is a terrible idea.

To simplify creating fixtures I have created an export script for phpMyAdmin. It uses the export feature of phpMyAdmin and supports whole table export or selected rows.


To install extract the cakefixture.php file and place in the libraries/export directory of phpMyAdmin. A 'CakePHP Fixture' option will now be available for export

Model Class names

Unfortunately the exporter cannot access the CakePHP inflector so tries a very primitive guess at what the class name should be from the table name, it works in the most common cases, however you need to check the class names are correct.