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