You are reading the manual of phpspec 8.x. The latest version is phpspec 9.x.

Quick StartΒΆ

Create a composer.json file:

{
    "require-dev": {
        "phpspec/phpspec": "^7.0"
    },
    "config": {
        "bin-dir": "bin"
    },
    "autoload": {"psr-0": {"": "src"}}
}

Follow the instructions on this page to install composer: https://getcomposer.org/download/.

Install phpspec with composer:

composer install

Start writing specs:

bin/phpspec desc Acme/Calculator

Learn more from the documentation.