Posts marked with “unit testing”

Getting Started With Test-Driven Development

by · July 1, 2020

0
 

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 […]

 

Education Station: Unit Testing Basics

by · February 6, 2020

0
 

By Chris Tankersley 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 […]

 

Education Station: Unit Testing Basics

by · January 3, 2020

0
 

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.

 

Pragmatic PHP: Testing Singletons

by · October 2, 2019

0
 

This month wraps up our singleton coverage. We’ll see the self registry variant (a self-contained registry pattern implementation). We’ll find ways to test singletons and learn how to test database memoization without requiring an actual database.

 

Easier Mocking with Mockery

by · December 21, 2018

0
 

Mockery tries to provide an easy to read and understand API, which is also versatile enough, so any scenario that might come up when working with mock objects in our test cases are covered. In this first part, we’ll see how Mockery can be used to create different test doubles and how they fit into […]

 

Better Practice – December 2018

by · December 11, 2018

0
 

Practice and more practice are the keys to adopting modern software engineering practices. It doesn’t matter if you’re using WordPress or Drupal to manage website content, trying to learn unit testing, get hired, or looking for better ways to manage date and time data—there’s always an opportunity to learn how to do it better. This issue rounds up articles on each of these topics to help you deepen your problem-solving skills.

 

How to Learn PHP Unit Testing With Katas

by ·

0
 

Sometimes code is first tested when the unfortunate client or user feels like using the feature and tests the developer’s work. Hopefully, they’re not disappointed. That’s why you should be interested in unit testing and Test-Driven Development (TDD)—because it makes your life as a programmer better.

 

Treasures, Old & New – May 2018

by · May 1, 2018

1
 

Writing clean code, managing technical debt, testing with Mockery, Toxic Tech, API specifications, and more.

 

Easier Mocking with Mockery, Part 2

by ·

0
 

In part one, we laid the practical groundwork for using test doubles. Let’s explore the parts of Mockery that, in some cases, exit the realm of everyday usage and see how it can help us in dealing with scenarios we might have thought impossible to test like static method calls, spying on objects, and more.

 

Testing in Practice – April 2018

by · April 2, 2018

0
 

PHP Unit, Mockery, Type Hints, Async PHP, building a REST API, training programs, PHP isolation and security, serverless computing, Laravel auth, and more.