Source

						public function testConnectionAutoInstantiation() {
		Connections::add('conn-test', $this->config);
		Connections::add('conn-test-2', $this->config);

		$this->skipIf(!MySql::enabled(), 'MySql is not enabled');
		$this->skipIf(!$this->_canConnect('localhost', 3306), 'Cannot connect to localhost:3306');

		$this->expectException('/mysql_get_server_info/');
		$this->expectException('/mysql_select_db/');
		$this->expectException('/mysql_pconnect/');
		$result = Connections::get('conn-test');
		$this->assertTrue($result instanceof MySql);

		$result = Connections::get('conn-test');
		$this->assertTrue($result instanceof MySql);

		$this->assertNull(Connections::get('conn-test-2', array('autoCreate' => false)));
	}