CakePHP Unit Testing

Accelerate Your Development

34 readers

100% Happiness guarantee Learn more

Minimum: $9.99

Suggested: $14.99+

Ways to buy

  • Free sample download
  • 34 readers
  • 113 pages
  • 100% complete
  • Book language: English

About the Book

I wrote this book for the following audiences:

  • People who have programming skills and want to improve the quality of their code.
  • People who have heard about unit testing but are still not clear what it is or how it works.
  • People who love CakePHP and want to take advantage of what it offers.
  • People who have spent a lot of time searching for bugs after a 3rd party upgrade.

The examples in this book use CakePHP, but the first half of the book is not framework or language specific. I hope unit testing and the ideas presented in this book will help you as much as they’ve helped me.

Buy A Bundle, And Save

About the Author

About the Contributors

  • András Halter artwork


  • Eric Bernasek editor


The Leanpub Unconditional, No Risk, 100% Happiness Guarantee


Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up. See full terms.

If you buy a Leanpub book you get all the updates to the book for free! All books are available in PDF, EPUB (for iPad) and MOBI (for Kindle). There is no DRM. There is no risk, just guaranteed happiness or your money back.

Table of Contents

  • Introduction
  • About the Book
    • Why I Wrote This Book
    • My Development Environment
    • Who This Book Is For
  • About the Author
  • Thanks
  • My E-books on CakePHP
    • CakePHP Unit Testing
    • CakePHP User Authentication
  • What Is Unit Testing
    • Arguments
    • Why Should We Write Tests?
  • What Is CakePHP
    • Main Features
  • Clean Code
    • How Tests Help Write Clean Code
  • Test Driven Development
    • TDD Development Cycle
  • Development Cycle
    • Understanding the Challenge
    • Planning
    • Installation
    • Coding, Testing, Documenting and User Feedback
    • Topics Not Covered
  • Preparing for Testing
    • Installing
    • Preparing
  • Fixtures
    • Creating Fixtures
    • Loading Fixtures Into Your Tests
  • Model Tests
    • Test Function Names
    • Assertions
    • Fail First
    • Passing Test
  • Test Callbacks
  • Controller Tests I.
    • Return Types
    • POST and GET Requests
  • Mocks
    • Expects Method
    • A More Complex Mock Example
    • Mocking Core PHP Functions
  • Controller Tests II.
    • Redirects
    • Debug
  • Test Suites
  • Testing from Command Line
  • Goodies
    • Code Coverage
    • Fixtures Data
    • Testing Private Methods
  • References by Chapters
    • What Is Unit Testing
    • Clean Code
    • Test Driven Development
    • Development Cycle
    • Others

Last updated

This Book is for Sale Through Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed books like this one.



Leanpub has a wide selection of in-progress and completed books available to browse, purchase, and enjoy.

Browse the Bookstore


Leanpub is free for authors and publishers to use. We pay authors or publishers 90% royalties minus 50 cents per sale.

Write a Book