Magento and Testing. Well, those are two words that you don’t hear together very often, do you?

That is the main motivation behind this book. My attempt to lower the barrier of entry that a lot of developers experience when trying to build testable extensions.

By buying the early access version, you will get the DRM free book in the following formats at an introductory price:

  • PDF
  • Epub
  • Mobi


Why read this book?

Testing is not a topic often discussed in the Magento community; and honestly, it is not surprising. Building proper tests for a Magento extension can be difficult for seasoned veterans let’s not say the junior developer just getting started with Magento.

If you are anything like me, you probably started thinking or still think that testing code is annoying and a waste of time. After all, you have written code like this a thousand times before; You know what you are doing right?

And yet, how much time of your day to day do you spend tracking and fixing bugs? What if you could do something that gave you confidence, not only on the quality of the code that is being promoted, confidence that if and when, someone has to make changes to the code there are tests that can confirm that nothing has been broken and the application still performs as expected.

What will you learn from this book?

We will learn TDD (Test Driven Development), of course, and we will be focusing on two particular tools:

  • Behat
  • PHPSpec

We will start by introducing both tools, the language, the core concepts behind each tool, and what role they play on our testing workflow. Along the way, we will start writing practical examples and exploring how these tools can work with Magento.

If I did my job right, by the end of the book, you should have a clear understanding of the testing tools, the methodologies used, and how to apply them in your everyday Magento development workflow, and all of this while having fun learning how to test your code.

What This Book Is:


Let’s face it, you have better things to do than read programming books all day long.

Easy to understand

My main goal with this book is to introduce you to the testing mindset and make it as easy as possible for developers of all levels to start testing their Magento modules.


The tone of this book is meant to be approachable and light hearted, and at the same time deliver solid advice and content.

What This Book Isn’t:

The ultimate reference for Magento Testing

We will focus only on a few of the many tools available for Magento testing.

A list of all the testing tools and frameworks

This book focuses on the best testing tools and frameworks. There are other ways to test Magento extensions, but this book will walk you through setting up a method that in my opinion works the best.

A complete manual for all the tools listed

This book by no means should be the end of your testing journey, but just the beginning; there is much more to learn and experiment with.

About Early Access

The book is currently on Early Access mode; This means that if you buy it right now you will only get the first part of the book.

Part 1 covers all the theory and history behind the tools and methodologies we will use for testing. It is critical that we understand how TDD/BDD involves more than blindly writing tests and is part of a complete workflow.

In Part 2, we will get our hands dirty and build a payment extension from scratch, we will put all the theory we learned on Part 1 directly into practice, and on top of that we will have fun (I promise!).