---
title: "Discussion on \"Brain Monkey Tutorial: Simplified Unit Testing for WordPress\" | Hashnode"
description: "Discussion on \"Brain Monkey Tutorial: Simplified Unit Testing for WordPress\". Unit testing in WordPress can be tricky due to its reliance on global functions and hooks. Brain Monkey simplifies this process by allowing you to mock WordPress functions, hooks, and filters easily. This tutorial will guide you through setting up a ..."
url: "https://hashnode.com/posts/brain-monkey-tutorial-simplified-unit-testing-for-wordpress/675de88b141c7cba6c429f7d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Brain Monkey Tutorial: Simplified Unit Testing for WordPress](https://junaidbinjaman.hashnode.dev/brain-monkey-tutorial-simplified-unit-testing-for-wordpress?utm_source=hashnode&utm_medium=feed)

Unit testing in WordPress can be tricky due to its reliance on global functions and hooks. Brain Monkey simplifies this process by allowing you to mock WordPress functions, hooks, and filters easily. This tutorial will guide you through setting up a ...

Dec 14, 2024 · 3 min read · junaidbinjaman.hashnode.dev  
Updated Jan 3, 2025  
Read the article

-   [#php-testing-unittesting-phpunit](https://hashnode.com/tag/php-testing-unittesting-phpunit)
-   [#wordpress](https://hashnode.com/tag/wordpress)
-   [#plugin-development-company](https://hashnode.com/tag/plugin-development-company)

## Written by

[Junaid Bin Jaman](https://hashnode.com/@junaidbinjaman)

@junaidbinjaman · Dhaka, Bangladesh

  
[View profile](https://hashnode.com/@junaidbinjaman)

Web & Moile App Developer

Hello! I'm a software developer with over 6 years of experience, specializing in React and WordPress plugin development. My passion lies in crafting seamless, user-friendly web applications that not only meet but exceed client expectations. I thrive on solving complex problems and am always eager to embrace new challenges. Whether it's building robust WordPress plugins or dynamic React applications, I bring a blend of creativity and technical expertise to every project.

## Responses 1

Markdown supported · ⌘↵ to post

[Slobodan Alavanja](https://hashnode.com/@slobich)

[Jan 27, 2025](https://hashnode.com/posts/brain-monkey-tutorial-simplified-unit-testing-for-wordpress/675de88b141c7cba6c429f7d/comment/679760c41e0316e474f575cd)

Hey. I tried your tutorial but I got a lot of PHP errors and the tests don't run. I can't send you a link to the output since it's my first comment. The first error is:

"1) MyPluginTest::test\_my\_plugin\_add\_greeting Error: Call to undefined function my\_plugin\_add\_greeting()"

All the rest are the same as the plugin file is not loading. Also there is an error about Brain Monkey: Error: Call to undefined method Mockery\\Expectation::withConsecutive().

Is there something I'm missing? Hope you can help.
