summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/DB_driver_test.php
blob: 9e16e29b4bcc4faac4538d7b74b1827c0e9db328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

class DB_driver_test extends CI_TestCase {

	public function test_initialize()
	{
		$config = Mock_Database_DB::config(DB_DRIVER);
		$driver_name = current(explode('/', DB_DRIVER));
		$driver = $this->$driver_name($config[DB_DRIVER]);

		$this->assertTrue($driver->initialize());
	}

	protected function pdo($config)
	{
		return new Mock_Database_Drivers_PDO($config);
	}

	protected function mysql($config)
	{
		return new Mock_Database_Drivers_Mysql($config);
	}

	protected function sqlite($config)
	{
		return new Mock_Database_Drivers_Sqlite($config);
	}

	protected function pgsql($config)
	{
		return new Mock_Database_Drivers_Postgre($config);
	}

}