In order to help migrate a CakePHP 1.3 app to CakePHP 2 I wanted to get the SimpleTests I created for 1.3 working in v2 so that I can be sure the migration has worked correctly. The Cake docs suggest that SimpleTest will work with CakePHP 2:
Of course you can continue to use SimpleTest in your application by replacing the related files.
http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html#phpunit-instead-of-simpletest
Well… maybe you can but I tried a few different things and couldn’t get it to work at all. I put SimpleTest in my vendors directory in 2.3 and tried replacing webroot/test.php with the same file from 1.3 (+ fixing paths), moving the files from cake/tests/lib/ (1.3) to lib/Cake/TestSuite (2.3) and renaming to the new filename conventions. Nothing I tried worked….
Eventually I ran out of things to try… so I asked on the official CakePHP IRC channel. Unfortunately no-one there could help either. The main suggestion was that I shouldn’t use SimpleTest and should just migrate to PHPUnit which unfortunately misses the point of using tests to help make sure the migration was a success. If you migrate your test suite at the same time then it defeats the object of the exercise.
Unfortunately the result was that I couldn’t get CakePHP 2 to work with SimpleTest and neither the documentation or people on the official CakePHP IRC channel could help… so I did have to migrate my test suite (to PHPUnit) at the same time as migrating my app from CakePHP 1.3 to 2. This was pretty disappointing but, if there’s one tiny positive from this, I could at least refer to the tests I’d written previously when creating the new ones rather than having to come up with a list of things to test again.