Permalink
Browse files

Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5

* 'PHP-5.5' of git.php.net:php-src:
  Really fix test pdo_mysql_class_constants.phpt
  • Loading branch information...
2 parents 6b0b4bf + 6e4cfa1 commit 6fd8b65cfbd26ec331c5524688cb46aeb23ba4dd @dstogov dstogov committed Dec 12, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
@@ -3,6 +3,11 @@ PDO MySQL specific class constants
--SKIPIF--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
+if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) {
+ /* Need connection to detect library version */
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+ MySQLPDOTest::skip();
+}
?>
--FILE--
<?php
@@ -29,9 +34,13 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
$expected['MYSQL_ATTR_READ_DEFAULT_GROUP'] = true;
}
- if (extension_loaded('mysqli')
- && (stristr(mysqli_get_client_info(), "mysqlnd") || mysqli_get_client_version() > 50605)
- || MySQLPDOTest::getClientVersion(MySQLPDOTest::factory()) > 50605) {
+ if (extension_loaded('mysqlnd')) {
+ $expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
+ } else if (extension_loaded('mysqli')) {
+ if (mysqli_get_client_version() > 50605) {
+ $expected['MYSQL_ATTR_SERVER_PUBLIC_KEY'] = true;
+ }
+ } else if (MySQLPDOTest::getClientVersion(MySQLPDOTest::factory()) > 50605) {
/* XXX the MySQL client library version isn't exposed with any
constants, the single possibility is to use the PDO::getAttribute().
This however will fail with no connection. */

0 comments on commit 6fd8b65

Please sign in to comment.