When I get started writing unit tests in WordPress, I continuously ran into what seemed to be strange behaviours by the WordPress Unit Testing framework. Strange when comparing to other PHP…
The WP_UnitTestCase class has a factory() method that gives access to the WP_UnitTest_Factory factory classes. And it’s these classes that you use to create data objects (called fixtures) like posts,…
A step by step refactoring of a function to use early returns. This technique makes the code easier to read and understand.
The block editor color settings interface allows users to customize the colors of a block. This includes the: In this article, we’ll first look at what these color settings are,…
Code review has been an integral part of my career as a developer. Whether it in the beginning through reviewing themes for WordPress.org, reviewing client code at WordPress.com VIP, or…
The WordPress Unit Testing Framework contains a set of custom assertion helper methods which help with writing unit test. In this post, we’ll present these helper methods available through the…