Archive of posts from June 2013

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

Glossary – Sprint 3 start

Story By the end of this sprint we will have migrated the current application from CakePHP 1.3 to CakePHP 2.3. We will have also deployed the new codebase into production. Sprint tasks Create a new branch in the git repo Migrate the code Confirm the existing SimpleTest test suite reports no errors Test the deployment to a fresh CakePHP 2 install Merge branch into master Move code into production Expected duration One – two weeks.... Read on

Glossary – Sprint 2 complete

Sprint tasks review Work out how to extend SimpleTest to a test database with the WebTester Complete – see documentation. Create Integration Tests Created tests for Terms (public and admin functionality) Created tests for Groups (public and admin functionality) Created tests for Links (public and admin functionality) Created tests for other ancilliary models (admin functionality mainly) Complete – tests created 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