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