Exemple #1
0
 public function initialize()
 {
     $this->connection->connect();
     if (false === $this->channel->isInitialized()) {
         $this->channel->initialize();
     }
     if (false === $this->exchange->isInitialized()) {
         $this->exchange->initialize();
     }
     $this->initialized = true;
 }
Exemple #2
0
 public function it_should_initialize(Connection $connection, Channel $channel, Exchange $exchange)
 {
     $connection->connect()->shouldBeCalled();
     $channel->isInitialized()->willReturn(false);
     $exchange->isInitialized()->willReturn(false);
     $channel->initialize()->shouldBeCalled();
     $exchange->initialize()->shouldBeCalled();
     $this->initialize();
     $this->isInitialized()->shouldReturn(true);
 }
Exemple #3
0
 public function it_should_configure_connection(Connection $connection, Channel $channel, Exchange $exchange, Queue $queue)
 {
     $connection->connect()->shouldBeCalled();
     $channel->isInitialized()->willReturn(false);
     $channel->initialize()->shouldBeCalled();
     $exchange->isInitialized()->willReturn(false);
     $exchange->initialize()->shouldBeCalled();
     $queue->isInitialized()->willReturn(false);
     $queue->initialize()->shouldBeCalled();
     $this->initialize();
 }