/**
  * @test
  */
 public function is_should_concatenate_vectors()
 {
     if ($this->coll instanceof MapInterface) {
         $this->coll->add(new Pair(0, 1))->add(new Pair(1, 2))->add(new Pair(3, 4));
     } else {
         $this->coll->add(1)->add(2)->add(4);
     }
     $coll2 = new Vector([3]);
     $concatenated = $this->coll->concat($coll2);
     $this->assertEquals([1, 2, 4, 3], $concatenated->toArray());
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function subscribe(EventListenerInterface $eventListener)
 {
     $this->eventListeners->add($eventListener);
 }
 /**
  * Add a new channel
  *
  * @return integer
  */
 public function addChannel()
 {
     $channel = $this->connection->channel();
     $this->channels->add($channel);
     return $channel->getChannelId();
 }