コード例 #1
0
ファイル: ChannelFactorySpec.php プロジェクト: Evaneos/Hector
 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);
 }
コード例 #2
0
ファイル: ChannelFactory.php プロジェクト: Evaneos/Hector
 /**
  * @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;
 }