Exemplo n.º 1
0
 public function testCreateExchangeWithResource()
 {
     $exchangeOptions = $this->prophesize(ExchangeOptions::class);
     $exchangePrototype = $this->prophesize(Exchange::class);
     $resource = $this->prophesize(\AMQPExchange::class);
     $exchangePrototype->setResource($resource->reveal())->shouldBeCalled();
     $exchangePrototype->setChannel(Argument::type(Channel::class))->shouldBeCalled();
     $exchangePrototype->setOptions($exchangeOptions->reveal())->shouldBeCalled();
     $channel = new Channel($exchangePrototype->reveal());
     $exchange = $channel->createExchange($exchangeOptions->reveal(), $resource->reveal());
     static::assertInstanceOf(Exchange::class, $exchange);
 }