summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/database/DB_driver_test.php
blob: 13e9abf84408364260a1fa0efabc6ba34c2e4880 (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
35
36
37
<?php

class DB_driver_test extends CI_TestCase {

	public function test_initialize()
	{
		$config = Mock_Database_DB::config(DB_DRIVER);
		sscanf(DB_DRIVER, '%[^/]/', $driver_name);
		$driver = $this->{$driver_name}($config[DB_DRIVER]);
	}

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

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

	protected function mysqli($config)
	{
		return new Mock_Database_Drivers_Mysqli($config);
	}

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

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

}