phpspec

phpspec

phpspec is a development tool, designed to help you achieve clean and working PHP code by using a technique derived from test-first development called (spec) behaviour driven development, or SpecBDD.

Example spec file:

<?php

namespace spec;

use PhpSpec\ObjectBehavior;

class MarkdownSpec extends ObjectBehavior {

    function it_converts_plain_text_to_html_paragraphs() {
        $this->toHtml("Hi, there")->shouldReturn("<p>Hi, there</p>");
    }

}

Running it is easy:

$ bin/phpspec run

> spec\Markdown

  ✔ it converts plain text to html paragraphs

1 examples (1 passed)
247ms

Installation via composer:

$ composer require phpspec/phpspec:~2.0

phpspec →