Example #1
0
 public function it_should_check_if_contain_exchange(Exchange $a, Exchange $b, Channel $channel)
 {
     $a->getFingerPrint()->willReturn('a');
     $b->getFingerPrint()->willReturn('b');
     $this->addExchange($a);
     $this->addExchange($b);
     $a->isEqual('b', $channel)->willReturn(false);
     $a->isEqual('a', $channel)->willReturn(true);
     $a->isEqual('c', $channel)->willReturn(false);
     $b->isEqual('b', $channel)->willReturn(true);
     $b->isEqual('a', $channel)->willReturn(false);
     $b->isEqual('c', $channel)->willReturn(false);
     $this->hasExchange('a', $channel)->shouldReturn(true);
     $this->hasExchange('b', $channel)->shouldReturn(true);
     $this->hasExchange('c', $channel)->shouldReturn(false);
 }
Example #2
0
 /**
  * @param Exchange $exchange
  */
 public function addExchange(Exchange $exchange)
 {
     $this->exchanges[$exchange->getFingerPrint()] = $exchange;
 }