1--TEST--
2MySQL PDO class interface
3--SKIPIF--
4<?php
5require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6require_once(dirname(__FILE__) . 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(dirname(__FILE__) . 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		'__wakeup'							=> true,
33		'__sleep'							=> true,
34		'getAvailableDrivers'	=> true,
35	);
36	$classname = get_class($db);
37
38	$methods = get_class_methods($classname);
39	foreach ($methods as $k => $method) {
40		if (isset($expected[$method])) {
41			unset($expected[$method]);
42			unset($methods[$k]);
43		}
44		if ($method == $classname) {
45			unset($expected['__construct']);
46			unset($methods[$k]);
47		}
48	}
49	if (!empty($expected)) {
50		printf("Dumping missing class methods\n");
51		var_dump($expected);
52	}
53	if (!empty($methods)) {
54		printf("Found more methods than expected, dumping list\n");
55		var_dump($methods);
56	}
57
58	print "done!";
59--EXPECT--
60done!
61