Writing Unit Tests with PHPUnit, Part 1: The Set Up A guide to getting started with writing PHPUnit tests through the use of a basic cache and using the setUp method of the framework.

Earlier this month, we began looking at installing PHPUnit in Visual Studio Code with the ultimate goal of learning how to write unit tests for our WordPress-based projects.

To that end, this post assumes that you’ve read the following posts and it assumes that you’ve caught up with a handful of previous posts:

  1. A WordPress Development Environment (Using a Package Manager)
  2. An IDE for WordPress Development
  3. Working with User Settings in Visual Studio Code

And, of course, installing PHPUnit in Visual Studio Code as linked above. Once that’s done, we’ll be ready to proceed. But one thing to keep in mind is that this will night be a traditional or a comprehensive course in writing unit tests.

Intalling PHPUnit in Visual Studio Code: Installing the PHPUnit Extension

Instead, it’s all about writing unit tests for WordPress projects.

Continue readingWriting Unit Tests with PHPUnit, Part 1: The Set Up A guide to getting started with writing PHPUnit tests through the use of a basic cache and using the setUp method of the framework.