Archive of posts with the category 'Code'


Using SimpleTest with CakePHP 2 (can you?)

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... Read on

Migrating a CakePHP 1.3 app to CakePHP 2 – a few gotchas

Firstly, make sure you read the 2.0 Migration Guide. Then follow the instructions for using the Upgrade shell. Having done this I found there were a few things that the shell hadn’t done: The app/Controller directory should contain AppController.php and PagesController.php (in addition to your newly renamed controllers). In my case these files weren’t copied across so I had to do this manually from the source tarball. The app/Model directory should contain AppModel.php but I... Read on

Using a test database with CakePHP1.3 and SimpleTest’s WebTestCase

Background The background to this project is that I’m having to migrate an existing CakePHP 1.3 application to CakePHP 2. Most importantly I want to be able to test the application once I’ve migrated it (using the same test suite used in 1.3) to make sure it still works as expected. Once that’s done I can deploy the upgraded app and then set about re-writing the tests to use PHPUnit. The CakePHP 2 migration notes... Read on