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 ...
junaidbinjaman.hashnode.dev3 min read
Slobodan Alavanja
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.