public function it_should_create_channel_from_connection_name(ConnectionRegistry $connectionRegistry, ChannelRegistry $channelRegistry, Connection $connection, Identity $identity)
 {
     $connectionRegistry->getConnection('default')->willReturn($connection);
     $channel = $this->createFromConnectionName('default', $identity);
     $channelRegistry->addChannel($channel)->shouldHaveBeenCalled();
     $channel->shouldBeAnInstanceOf(Channel::class);
 }
Exemple #2
0
 /**
  * @param Connection $connection
  * @param Identity   $identity
  *
  * @return Channel
  */
 public function createFromConnection(Connection $connection, Identity $identity)
 {
     $channel = new Channel($connection, $identity);
     $this->channelRegistry->addChannel($channel);
     return $channel;
 }