Create a composer.json
file:
{
"require-dev": {
"phpspec/phpspec": "^3.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:
php composer.phar install
Start writing specs:
bin/phpspec desc Acme/Calculator
Learn more from the documentation.