It's all about my technology & social adventures…

Tag PHPUnit

Unit testing WordPress plugin in isolation with WP_Mock

In Unit Testing, the word “Unit” actually denotes testing the code in small chunks, that is small units. So what does it mean? Testing each method in a class without any other dependencies. In the WordPress world, testing code without… Continue Reading →

Custom WP-CLI command and Unit testing with PHPUnit

WP-CLI is the command-line interface for WordPress to interact, manage and maintain it. Writing some custom CLI commands are necessary when we manage a large customised website or a complex plugin. It’s obvious that we need to write PHPUnit tests… Continue Reading →

Unit Testing Custom WordPress REST API

In a real-world scenario, we have to write some custom REST API endpoints to satisfy our business requirements, as one shoe will not fit for all right? So how do we make sure that our custom REST API always works… Continue Reading →

An Introduction to unit testing WordPress plugin using PHPUnit

Doing a complete test of our code is very important whenever we make some code changes or release a new version to make sure new functionality doesn’t break the existing ones. Doing it all manually is the very hard part… Continue Reading →

Installing PHPUnit on OSX

Well, before installing PHPUnit into your system, you need to check for some prerequisites. Prerequisite: PHP 5.6 or >5.6 PEAR (optional) Installing PHP 5.6 To install PHP 5.6, I am going to use curl which comes out of the box with… Continue Reading →

© 2024 Dhanendran's Blog — Powered by WordPress

Theme by Anders NorenUp ↑