O'Reilly logo

CakePHP 1.3 Application Development Cookbook by Mariano Iglesias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the test framework

In this recipe, we will learn how to prepare our CakePHP application with all the elements needed to create our own unit tests, setting up the foundation for the rest of the recipes in this chapter.

Getting ready

To go through the recipes included in this chapter, we need some data to work with. Create the following tables by issuing these SQL statements:

CREATE TABLE `articles`( `id`INT UNSIGNED NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) NOT NULL, `body` TEXT NOT NULL, PRIMARY KEY(`id`) ); CREATE TABLE `users`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `username` VARCHAR(255) NOT NULL, PRIMARY KEY(`id`) ); CREATE TABLE `votes`( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `article_id` INT NOT NULL, `user_id` INT ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required