예제 #1
0
 public function setInfoFromConnection(Connection $connection)
 {
     $this->connection = $connection->getAlias();
     if ($connection->isAuth()) {
         $this->authMode = true;
         $this->user = $connection->getAuthUser();
         $this->password = $connection->getAuthPassword();
     }
     $this->url = $connection->getBaseUrl() . $this->path;
     return $this;
 }
 /**
  * Register a new Collection.
  *
  * @param Connection $connection
  */
 public function registerConnection(Connection $connection)
 {
     $this->connections[$connection->getAlias()] = $connection;
 }
 public function it_should_return_default_connection_if_not_connection_is_defined(Connection $connection)
 {
     $connection->getAlias()->willReturn('default');
     $this->registerConnection($connection);
     $this->getConnection()->shouldHaveType('Neoxygen\\NeoClient\\Connection\\Connection');
 }