📃
Brain Monkey
  • Introduction
  • General
    • Installation
  • Functions testing tools
    • Setup for functions testing
    • Patching functions with when()
    • Bulk patching with stubs()
    • Testing functions with expect()
  • WordPress-specific tools
    • Why bother
    • WordPress testing tools
    • Setup for WordPress testing
    • Test added hooks
    • Test done hooks
  • More
    • Migration from v1
Powered by GitBook
On this page
  1. General

Installation

PreviousIntroductionNextSetup for functions testing

Last updated 5 years ago

To install Brain Monkey you need:

  • PHP 5.6+

Brain Monkey is available on Packagist, so the only thing you need to do is to add it as a dependency for your project.

That can be done by running following command in your project folder:

composer require brain/monkey:2.* --dev

As alternative you can directly edit your composer.json by adding:

{
  "require-dev": {
    "brain/monkey": "~2.0.0"
  }
}

I've used require-dev because, being a testing tool, Brain Monkey should not be included in production.

Brain Monkey can work with any testing framework, so it doesn't require any of them.

To run your tests you'll probably need to require a testing framework too, e.g. or .

Dependencies

Brain Monkey needs 2 libraries to work:

They will be installed for you by Composer.

When installed in development mode (to test itself), Brain Monkey also requires:

(BSD-3-Clause)

(MIT)

(MIT)

Composer
PHPUnit
phpspec
Mockery
Patchwork
PHPUnit