Esempio n. 1
0
 public function test_can_get_all_connections()
 {
     $this->container->shouldReceive('singleton')->twice();
     $this->container->shouldReceive('make')->with('doctrine.connections.default')->andReturn('connection1');
     $this->container->shouldReceive('make')->with('doctrine.connections.custom')->andReturn('connection2');
     $this->registry->addConnection('default');
     $this->registry->addConnection('custom');
     $connections = $this->registry->getConnections();
     $this->assertCount(2, $connections);
     $this->assertContains('connection1', $connections);
     $this->assertContains('connection2', $connections);
 }
Esempio n. 2
0
 /**
  * Gets an array of all registered connections.
  *
  * @return array An array of Connection instances.
  * @static 
  */
 public static function getConnections()
 {
     return \LaravelDoctrine\ORM\IlluminateRegistry::getConnections();
 }