Created
August 19, 2015 08:37
-
-
Save trq/4712dfdf01bac24a1942 to your computer and use it in GitHub Desktop.
This file contains 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\Opus\Service; | |
use PhpSpec\ObjectBehavior; | |
use Prophecy\Argument; | |
use Opus\Service\Container; | |
use Interop\Container\ContainerInterface; | |
class ContainerSpec extends ObjectBehavior | |
{ | |
function it_is_initializable() | |
{ | |
$this->shouldHaveType(Container::class); | |
$this->shouldImplement(ContainerInterface::class); | |
} | |
function it_can_set_and_get_service() | |
{ | |
$this->set('foo', function() { return new \StdClass(); }); | |
$this->get('foo')->shouldBeLike(new \StdClass()); | |
} | |
function it_can_check_existence_of_service(\StdClass $object) | |
{ | |
$this->set('foo', $object); | |
$this->has('foo')->shouldBe(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment