Examples of using Brain monkey in English and their translations into German
{-}
-
Colloquial
-
Official
-
Ecclesiastic
-
Medicine
-
Financial
-
Ecclesiastic
-
Political
-
Computer
-
Programming
-
Official/political
-
Political
Oh, you brain monkeys kill me.
Before ending the article, I want to left here that plugin API functions are not theonly functions that are already mocked by Brain Monkey for you.
Thanks to Brain Monkey we could do something like this.
PS: Brain Monkey is open source and very open to contributions.
Almost three years ago I started developing Brain Monkey which started as a single class of around 100 lines of code.
Brain Monkey uses Mockery, so its tearDown() function already calls Mockery::close.
With Mockery providing all the methods to mock and stub objects, and Brain Monkey bringing those features to functions we have everything we need to test WordPress plugin without loading WordPress.
Brain Monkey at its core do pretty much what I described above: it provides a"bridge" between the function redefinition of Patchwork and the mock creation of Mockery.
We will see soon how Brain Monkey will help us to obtain what we want without writing by hand any stub.
Brain Monkey documentation tells us that we need to do some setup to use it: we need to call Brain\Monkey\setUp() before each test, and Brain\Monkey\tearDown() after each test.
Because I want to show you how to use Brain Monkey I'm going to write few lines of code to extend our micro test framework with Brain Monkey capabilities.
Luckily, Brain Monkey has an API designed just to test WordPress plugins API.
If you have a look at Brain Monkey documentation for testing added hooks and fired hooks you will find more features to power your tests.
The first good news is that Brain Monkey defines already all the functions of plugins API in a way that is 100% compatible WordPress real code.
In short, thanks to Mockery and Brain Monkey we have the possibility to write unit tests for our plugin without loading WordPress in a way that is very easy to start with and produces quite maintainable tests.
Sure we can use Brain Monkey Functions\expect to create function stubs for add_action, add_filter, do_action, apply_filters, and all the other functions of plugins API, but that would require a lot of bootstrap code for each test, reducing(or nullifying) the convenience of running test without loading WordPress.
The computer learned what the monkey brain did.
That's not difficult with your little monkey brain.
The computer learned what the monkey brain did to move its arm in various ways.
The monkey brain is particularly suited to this purpose because it is similarly complex in structure to that of humans.
Chilled monkey brains.
Waffle chitlins, monkey brains.
Bring me those monkey brains, and he will be fine.
When I was five, Buffy told me they were monkey brains and I.