Skip to content

Instantly share code, notes, and snippets.

@trq
Created August 19, 2015 08:37
Show Gist options
  • Save trq/4712dfdf01bac24a1942 to your computer and use it in GitHub Desktop.
Save trq/4712dfdf01bac24a1942 to your computer and use it in GitHub Desktop.
<?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