Monthly Archives: June 2015

Unit Tests in WordPress: Testing JavaScript With Karma

If you decide that you need to make unit tests on your plugin, it is because it’s quite complex and it’s probably a mix of PHP and JavaScript code. If you think that testing just your PHP code is enough, you are definitely on the wrong path. The JavaScript code can be as complex as the PHP counterpart, and as likely to have bugs in it.

Continue Reading


Unit Tests in WordPress: Installing PHPUnit

PHPunit is a unit test framework for PHP that will be used as a base for testing our PHP code under WordPress. I’ve found three guides on the web that helped me understanding how to install and configure PHPunit. It hasn’t been easy to understand the process because they use different approaches and methods, so you easily get confused.

Continue Reading


Unit Tests in WordPress: An Introduction

This is the first of a series of articles that I’ll make about unit tests in WordPress. I will celebrate my return to blogging with a topic that is hardly (if at all) covered online. Well to be honest there are a few great tutorials about unit testing out there that I’ve used for my personal research but I haven’t been able to find any information about testing together PHP and JavaScript, which is what I’ve accomplished at the end of my research.
Continue Reading