Пример #1
0
 public function it_should_create_exchange(Channel $channel, ExchangeRegistry $exchangeRegistry, ContextRegistry $contextRegistry, Context $context)
 {
     $contextRegistry->getExchangeContext('exchange')->willReturn($context);
     $exchange = $this->createNamed('exchange', $channel);
     $exchangeRegistry->addExchange($exchange)->shouldHaveBeenCalled();
 }
Пример #2
0
 /**
  * @param string  $name
  * @param Channel $channel
  *
  * @return Exchange
  */
 public function createNamed($name, Channel $channel)
 {
     $exchange = new Exchange($name, $channel, $this->contextRegistry->getExchangeContext($name));
     $this->exchangeRegistry->addExchange($exchange);
     return $exchange;
 }