Created
July 12, 2014 08:15
-
-
Save coreymcmahon/9393387be554395e13fe to your computer and use it in GitHub Desktop.
Mocking the Filesystem during BDD with Behat and PHPSpec - www.slashnode.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace spec; | |
use PhpSpec\ObjectBehavior; | |
use Prophecy\Argument; | |
class ConfigSpec extends ObjectBehavior | |
{ | |
function it_is_initializable() | |
{ | |
$this->shouldHaveType('Config'); | |
} | |
function it_gets_and_sets_an_option() | |
{ | |
$this->get('foo')->shouldReturn(null); | |
$this->set('foo', 'bar'); | |
$this->get('foo')->shouldReturn('bar'); | |
} | |
function it_gets_a_default_value_when_option_is_not_set() | |
{ | |
$this->get('foo')->shouldReturn(null); | |
$this->get('foo', 'bar')->shouldReturn('bar'); | |
$this->set('foo', 'not bar'); | |
$this->get('foo', 'bar')->shouldReturn('not bar'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment