A simple yet powerful BDD library for PHP 5
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Argh!? BDD! ARGH!! Mocks?!

Table of Contents

No. It's ArrBDD

A simple BDD library for PHP 5

Use array & closures. Make it simple.

Arr! - This one is often confused with Arrrgh, which is of course the sound you make when you sit on a belaying pin. "Arrr!" can mean, variously, "yes," "I agree," "I'm happy," "I'm enjoying this beer," "My team is going to win it all,"... It's the Pirate lingo, rich and complicated, sort of like a good stew.

How'd this fit into da PHP world? Well, of coz' it does! C'mon, lad, it's Pirates Helping Pirates! Aye aye!

Argh!? But just how?

Arr! BDD? Specs?:

     * Simplest form. Check out the test examples for more
    $specs["The 'Hello world' string"] = array(
        'subject' => function(){
            return 'Hello world';
        "SHOULD be 11 characters long" => function($hello){
            return (strlen($hello)===11);
        "AND start with 'Hello'" => function($hello){
            return (strpos($hello, 'Hello')===0);

Arr! Mock:

    // Follow this order method -> arguments -> returns
             ->returns(array('', ''));

    // Method without arguments    

    // Mock static methods

YEah! Getting results

Run the test and get some JSON results: JSONView for Chrome JSONView for Firefox

BDD results

Or use bArr - a sophisticated BDD result viewer tool.

bArr, BDD result viewer