Skip to content

Instantly share code, notes, and snippets.

@iakio
Created March 8, 2014 04:31
Show Gist options
  • Save iakio/9425389 to your computer and use it in GitHub Desktop.
Save iakio/9425389 to your computer and use it in GitHub Desktop.
<?php
namespace spec;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class ExampleSpec extends ObjectBehavior
{
function let(\StdClass $obj1, \StdClass $obj2)
{
$obj1->name = "One";
$obj2->name = "Two";
$this->obj1 = $obj1;
$this->obj2 = $obj2;
}
function it_have_obj1(\StdClass $obj1)
{
$this->obj1->shouldBe($obj1);
$this->obj1->name->shouldBe("One");
}
function it_have_obj2(\StdClass $obj2)
{
$this->obj2->shouldBe($obj2);
$this->obj2->name->shouldBe("Two");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment