function its_nested_request_resolvers_can_have_priority(Request $request, RequestResolverInterface $firstRequestResolver, RequestResolverInterface $secondRequestResolver, RequestResolverInterface $thirdRequestResolver, ChannelInterface $channel)
 {
     $firstRequestResolver->findChannel($request)->shouldNotBeCalled();
     $secondRequestResolver->findChannel($request)->willReturn($channel);
     $thirdRequestResolver->findChannel($request)->willReturn(null);
     $this->addResolver($firstRequestResolver, -5);
     $this->addResolver($secondRequestResolver, 0);
     $this->addResolver($thirdRequestResolver, 5);
     $this->findChannel($request)->shouldReturn($channel);
 }
Ejemplo n.º 2
0
 /**
  * @param Request $request
  *
  * @return ChannelInterface
  */
 private function getChannelForRequest(Request $request)
 {
     $channel = $this->requestResolver->findChannel($request);
     $this->assertChannelWasFound($channel);
     return $channel;
 }
Ejemplo n.º 3
0
 function it_throws_a_channel_not_found_exception_if_request_resolver_returns_null(RequestResolverInterface $requestResolver, RequestStack $requestStack, Request $masterRequest)
 {
     $requestStack->getMasterRequest()->willReturn($masterRequest);
     $requestResolver->findChannel($masterRequest)->willReturn(null);
     $this->shouldThrow(ChannelNotFoundException::class)->during('getChannel');
 }