2017 © Pedro Peláez
 

library sylph

Stubber

image

phpixie/sylph

Stubber

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Sylph

A simple and easy to use array to class stubber. Greatly improves the speed of writing class stubs. Here is a quick exxample:, (*1)

    $this->sylph = new \PHPixie\Sylph();
    $flowers = 7; //Will use it in an anonymous method later on
    $fairy = $this->sylph->cast(array(
        'name' => 'Tinkerbell',
        'likes' => array(
            'flying'  => true,
            'dancing' => true
        ),
        'pick_flowers' => function($picked) use($flowers){
            return $picked + $flowers;
        },
        'friend' => $this->sylph->cast(array(
            'name' => 'Trixie'
        ))
    ));

    $this->assertEquals('Tinkerbell', $fairy->name);
    $this->assertEquals(true, $fairy->likes['flying']);
    $this->assertEquals(true, $fairy->likes['dancing']);
    $this->assertEquals(10, $fairy->pick_flowers(3));
    $this->assertEquals('Trixie', $fairy->friend->name); 

The Versions

02/05 2013

dev-master

9999999-dev

Stubber

  Sources   Download

BSD

The Requires

  • php >=5.3.0

 

mock stub testing