Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (43 sloc) 2.159 kB

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

Jump to Line
Something went wrong with that request. Please try again.