| 1 | <?php |
||
| 12 | class AliasSpec extends ObjectBehavior |
||
| 13 | { |
||
| 14 | function let() |
||
| 15 | { |
||
| 16 | $this->beConstructedWith('@foo'); |
||
| 17 | } |
||
| 18 | function it_is_initializable() |
||
| 19 | { |
||
| 20 | $this->shouldHaveType(Alias::class); |
||
| 21 | } |
||
| 22 | |||
| 23 | function its_a_definition() |
||
| 24 | { |
||
| 25 | $this->shouldBeAnInstanceOf(DefinitionInterface::class); |
||
| 26 | } |
||
| 27 | |||
| 28 | function it_uses_the_container_to_search_for_other_definitions(ContainerInterface $container) |
||
| 29 | { |
||
| 30 | $container->get('foo')->willReturn('bar'); |
||
| 31 | $this->setContainer($container); |
||
| 32 | $this->resolve()->shouldReturn('bar'); |
||
| 33 | } |
||
| 34 | |||
| 35 | function it_throws_container_not_set_exception_if_no_container_is_present() |
||
| 36 | { |
||
| 37 | $this->shouldThrow(ContainerNotSetException::class) |
||
| 38 | ->during('resolve'); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |