CakePHP Unit Testing cover page

CakePHP Unit Testing

CakePHP Unit Testing

Accelerate Your Development

rrd’s avatarrrd

CakePHP Unit Testing Edit
This book is 100% complete



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.

Read more

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
  • My CakePHP Plugins
  • 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

Read More

About the Author

About the Contributors


András Halter



Eric Bernasek


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