Featured Post

Creating one to many relation in Doctrine 2 ORM

Introduction In this tutorial I will present relational mapping between albums and songs. In Zend Framework 2 Tutorial we had only one table – it was called albums, and stored albums data. Today we will extend our sample application with new table – songs. Each album can has many songs, but...

Read More

Unit testing in Zend Framework 2

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 07-04-2013

Tags: , , , , , , , , ,

3

Overview

Today I would like to focus on the unit testing in applications made with Zend Framework 2 and Doctrine 2 ORM. Sample unit tests were included with Zend Framework 1.x and they are also attached to Zend Framework 2 Tutorial.

Important is, that we have two approaches of testing controllers for the latest version of the framework:

  • first, based on class PHPUnit_Framework_TestCase,
  • and the second, which uses AbstractHttpControllerTestCase class.