1--TEST--
2MySQL PDO class interface
3--SKIPIF--
4<?php
5require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
6require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7MySQLPDOTest::skip();
8$db = MySQLPDOTest::factory();
9if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
10	die("skip Transactional engine not found");
11?>
12--FILE--
13<?php
14	require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
15	$db = MySQLPDOTest::factory();
16
17	$expected = array(
18		'__construct'							=> true,
19		'prepare' 							=> true,
20		'beginTransaction'						=> true,
21		'commit'							=> true,
22		'rollBack'							=> true,
23		'setAttribute'							=> true,
24		'exec'								=> true,
25		'query'								=> true,
26		'lastInsertId'							=> true,
27		'errorCode'							=> true,
28		'errorInfo'							=> true,
29		'getAttribute'							=> true,
30		'quote'								=> true,
31		'inTransaction'							=> true,
32		'getAvailableDrivers'	=> true,
33	);
34	$classname = get_class($db);
35
36	$methods = get_class_methods($classname);
37	foreach ($methods as $k => $method) {
38		if (isset($expected[$method])) {
39			unset($expected[$method]);
40			unset($methods[$k]);
41		}
42		if ($method == $classname) {
43			unset($expected['__construct']);
44			unset($methods[$k]);
45		}
46	}
47	if (!empty($expected)) {
48		printf("Dumping missing class methods\n");
49		var_dump($expected);
50	}
51	if (!empty($methods)) {
52		printf("Found more methods than expected, dumping list\n");
53		var_dump($methods);
54	}
55
56	print "done!";
57--EXPECT--
58done!
59