1--TEST-- 2MySQL PDO->__construct() - URI 3--EXTENSIONS-- 4pdo_mysql 5--SKIPIF-- 6<?php 7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 8MySQLPDOTest::skip(); 9/* TODO - fix this limitation */ 10if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysql.sock") 11 die("skip Fix test to run in other environments as well!"); 12?> 13--INI-- 14pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock" 15--FILE-- 16<?php 17 require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); 18 19 $found = false; 20 $values = ini_get_all(); 21 foreach ($values as $name => $dsn) 22 if ('pdo.dsn.mysql' == $name) { 23 printf("pdo.dsn.mysql=%s\n", $dsn); 24 $found = true; 25 break; 26 } 27 28 if (!$found) { 29 $dsn = ini_get('pdo.dsn.mysql'); 30 $found = ($dsn !== false); 31 } 32 33 if (!$found) 34 printf("pdo.dsn.mysql cannot be accessed through ini_get_all()/ini_get()\n"); 35 36 if (MySQLPDOTest::getDSN() == $dsn) { 37 // we are lucky, we can run the test 38 try { 39 40 $user = PDO_MYSQL_TEST_USER; 41 $pass = PDO_MYSQL_TEST_PASS; 42 $db = new PDO('mysql', $user, $pass); 43 44 } catch (PDOException $e) { 45 printf("[001] %s, [%s] %s\n", 46 $e->getMessage(), 47 (is_object($db)) ? $db->errorCode() : 'n/a', 48 (is_object($db)) ? implode(' ', $db->errorInfo()) : 'n/a'); 49 } 50 51 } 52 53 print "done!"; 54?> 55--EXPECT-- 56pdo.dsn.mysql cannot be accessed through ini_get_all()/ini_get() 57done! 58