Test Magento with PHPUnit

View class schedule

Learning Objectives

At the end of this course, you will be able to:

  • Describe the different types of testing and what each category of testing does
  • Identify the currently available tools for automated testing and describe some of the differences between them including when one might be chosen over another
  • Explain how to set up and run PHPUnit tests
  • Describe how to create PHPUnit test cases for Magento code


This course assumes the student has taken the Fundamentals of Magento Development course and/or has equivalent knowledge of basic Magento architectural concepts. No prior knowledge of the basic testing tools or automated testing is required.

Course Description

This course serves as an introduction to testing in Magento and how to create automated tests using PHPUnit. Further it provides a discussion of the advantages and disadvantages of different type of automated testing to aid in choosing which type to use and provides an overview of other testing tools. Course based on Magento Enterprise Edition 1.14.

Course Outline

1. Testing Types
  • Unit Testing
  • Integration Testing
  • Functional Testing
  • System Testing
  • Performance Testing
  • A/B Testing
2. Nomenclature
  • Fixtures
  • Stubs
  • Mock Test Doubles
3. Related Topics
  • Continuous integration, continuous delivery (CICD)
  • Test driven development (TDD)
  • Behavior driven development (BDD)
4. Tools Overview
5. Using PHPUnit
  • Set up PHPUnit
  • Create PHPUnit test cases
  • Testing Magento with native PHPUnit
  • Workarounds for limitations of Magento in regards to testing