For the last recipe of this chapter, we will write an automated test with PHPUnit. PHPUnit is the unit testing framework that we have installed in the previous chapter.
Unit testing is a key part of Test Driven Development (TDD). With TDD, we will write the test case first, and then we will write the code that returns the expected values that we defined in the test case.
With Magento, which is based on the Zend Framework and built with TDD, it is possible to write unit tests with PHPUnit for a custom or existing module. In this recipe, we will see all the steps that you have to perform for a custom unit test.
In this recipe, we will create a unit test for the Packt_Helloworld
module that we created and extended in Chapter 4, Creating a Module, Chapter 6, Chapter 6, Databases and Modules, Chapter 7, Magento Backend, and Chapter 8, Event Handlers and Cronjobs.
If you don't have the complete code, you can download it from the Packt Publishing website http...