-
Book Overview & Buying
-
Table Of Contents
CakePHP 2 Application Cookbook - Third Edition
By :
You might have already heard that using "fat models, skinny controllers" is a best practice. One of the main benefits of keeping all your business logic inside your model layer is the ability to develop simpler unit tests for your application. Model classes usually depend only on other models, behaviors, or utility classes (libs), allowing you to quickly start coding your unit tests without a ton of mock object configurations.
CakePHP integrates with PHPUnit and provides several tools to help you build your unit tests:
In this recipe, we'll go over most of these, and build a unit test for a CakePHP model.
First, we'll reuse the table named tasks from this chapter or create a new one using the following SQL statement:
CREATE TABLE tasks ( id INT NOT NULL AUTO_INCREMENT...
Change the font size
Change margin width
Change background colour