Let’s learn about Integration testing today. Integration testing is a method of testing by passing in the real dependencies and thus testing out the integration between two or more objects.

Please check out Part 4, if you have not read it yet:

Taking the same previous example. We’ll do…


PHP Code Sniffer is a tool to detect violations of a defined coding standard such as PSR2. Read more about it here:

If you would also like to check out the accompanying YouTube video, here’s the link:

Now let’s go ahead and set it up.

  1. Add Code Sniffer…


How reliable are the tests we write? Are they covering the edge cases? What happens when the code changes? Do the tests still pass?

Welcome to testing our tests. Of course to make any tests reliable it has to cover all the edge cases that an application may find itself…


Hey there, welcome to part 4! Today we’ll learn how to mock. Mocking is a process where you create a fake instance of a real class, and test against it. This is so that, you do not have to worry about the real functionality of external dependencies inside a class…


Now continuing from Part 2, let’s revisit the test we were looking at:

Please check out Part 2, if you have not read it yet:

If you would also like to check out the accompanying YouTube video, here’s the link:

We learned that asserts are statements that…


All right, welcome to part 2 of “PHP Test Driven Development” series. Today we will go through the PHPUnit setup in detail.

Please check out Part 1, if you have not read it yet:

If you would also like to check out the accompanying YouTube video, here’s the link:


Test Driven Development is a coding practice where you write a test first then write the code to pass that test, usually in a short iterative cycle.

Test Driven Development (TDD), was popularized by . …


All right. Let’s go over and refactor our code from part one.

Let’s once again look at our FlightController:

First of all let’s move saveData() into a Repository class. It’s easy since all the Database related code is in this method. For your own code base, if you do…


When I first started using this architecture, I had no name for it. But having a name will make it easier for us to remember it. Let’s call it the “Extensible Architecture”. That is because, it is basically an extension to MVC. …


Before we go into the refactoring process, let’s first look at the alternatives we already have. We will go through each of them and weigh in their pros and cons. This will help us make a better decision.

This is a Part 2 to my earlier Part 1 on PHP…

Sameer Nyaupane

(Software Developer | Technical Writer | Speaker)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store