O'Reilly logo

Magento 1.4 Development Cookbook by Nurul Ferdous

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing your first Magento test case

Test Driven Development (TDD) has become a popular and widely accepted practice today. This is related to test-first programming concepts of extreme programming. Though in TDD the test cases should be written first, in this recipe, we will be writing test cases for legacy codes.

Magento is built on top of Zend Framework, which itself is tested and encourages Test Driven Development. In Magento, we can write unit tests using PHPUnit for our own module or any other existing modules for better acceptance. This recipe will guide you through to write your first test case for Magento. In this recipe, we will be writing tests for the News model of the News module.

Getting ready

Install PHPUnit, Xdebug, and PHP5-CLI ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required