Posts marked with “testing”

Community Corner: PHPUnit Creator Sebastian Bergmann, Part Two

by · October 20, 2021


Welcome to part two of our interview with Sebastian Bergmann. Last month we heard about Sebastian’s beginnings, how he got started with development and what led him to write the de facto testing suite for the PHP programming language. This month, Sebastian dives into what it’s like managing such a widely used and crucial piece […]


It’s Really an Upgrade

by · September 12, 2021


We often consider improvements from what they’ll cost us, in time, effort, or money, in the short term and undervaluing the long-term benefits we’ll get. We cover practices that look daunting but are worthwhile in this issue, including PHP refactoring tools like Rector, Commands and Queries, PHP Unit, Strategic Domain-Driven Design, Livewire, and more.


The Workshop: Testing with Pest Framework

by · August 14, 2021


Pest is a PHP testing framework focused on simplicity and brings a powerful expectations API to PHP. Pest is influenced by Jest, a JavaScript testing framework. Pest was created by Nuno Maduro originally via Sponsorware license and ultimately was published under the MIT open source license. You can think of Pest ha an alternative to other testing frameworks, such as […]


Streamlining Behat

by · May 12, 2021


Behat, and feature tests overall, are crucial for giving you confidence that when you refactor code, you don’t change how an application works and for helping you understand how an application behaves in practice. Investing in integration and functional tests is worth it in the long term, and in this article, we’ll see how I […]


Let’s Discover Atoum

by ·


In the PHP world, if you ask most developers about testing frameworks, the first response you’ll get is PHPUnit. But there are several alternatives, and one of them is atoum. This article introduces you to atoum, the simple, modern, and intuitive unit testing framework! You will discover how to write fluent tests and execute them […]


Sustainable PHP: Database Playback Testing

by · January 8, 2021


While completing the Deep Analysis we discussed last month, I was faced with the inability to test. That’s because—I discovered–accounting data cannot be erased—even in the sandbox. There’s no way to begin each test with a clean test environment. This month we walk through a relatively convoluted solution. We’ll capture the accounting data as we […]


Getting Started With Test-Driven Development

by · July 1, 2020


As developers, we spend a large portion of our time testing code we’ve just written. In a traditional testing cycle, we write some code and manually test it until it’s error-free, but how do we know it will be error-free a year from now? Embracing Test-Driven Development (TDD) allows us to quickly build a suite […]


The Workshop: Specification BDD with Phpspec

by · May 5, 2020


phpspec is a package which allows us to use Behavior-Driven Development, BDD, which comes from Test-Driven Development, TDD. When applying BDD, we write our tests first and then only enough code to pass our tests and then refactor and verify the tests still pass exactly as we would with TDD. This cycle continues and is […]


Education Station: Integration and Functional Testing

by · February 4, 2020


Previously, we discussed unit testing and why it can be useful. Unit testing can help make sure the public-facing APIs for your classes are easier to understand. It helps map out the dependencies of your classes, and—more importantly—it helps ensure behavior does not change from release to release. Functional, or integration, testing allows you to […]


Education Station: Unit Testing Basics

by · January 3, 2020


Recently, we’ve discussed principles for writing clean code in your php applications. Testing is a valuable technique to help you produce and maintain a codebase, but it can be daunting to learn. In this article, we’ll start with unit testing. Let’s look at how tests help during the design phase and in maintenance, what unit tests are, and how to use PHPUnit for your test suite.