diff options
author | Anatol Belski <ab@php.net> | 2013-07-02 08:23:33 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2013-07-02 08:23:33 +0200 |
commit | 743c4864eb5c868a96d66180a562a00133861385 (patch) | |
tree | 7ada336283ac2d36360bef8a4a34fa901b461ef1 | |
parent | 06418aca285945253a5f558781c8151cd161327c (diff) | |
download | php-git-743c4864eb5c868a96d66180a562a00133861385.tar.gz |
Fixed mysql tests parsing phpinfo()
-rw-r--r-- | ext/pdo_mysql/tests/mysql_pdo_test.inc | 6 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc index 115aeadc5a..7a97bb4630 100644 --- a/ext/pdo_mysql/tests/mysql_pdo_test.inc +++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc @@ -162,8 +162,8 @@ class MySQLPDOTest extends PDOTest { phpinfo(); $tmp = ob_get_contents(); ob_end_clean(); - $tmp = stristr($tmp, "PDO Driver for MySQL => enabled"); - return (bool)preg_match('/Client API version.*mysqlnd/', $tmp); + return (preg_match('/PDO Driver for MySQL.*enabled/', $tmp) && + preg_match('/Client API version.*mysqlnd/', $tmp)); } static function dropTestTable($db = NULL) { @@ -174,4 +174,4 @@ class MySQLPDOTest extends PDOTest { } } -?>
\ No newline at end of file +?> diff --git a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt index a570c1fd49..9674e85f5e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_phpinfo.phpt @@ -18,10 +18,9 @@ $db = MySQLPDOTest::factory(); ob_end_clean(); /* PDO Driver for MySQL, client library version => 6.0.3-alpha */ - $expected = sprintf('Client API version => %s', - $db->getAttribute(PDO::ATTR_CLIENT_VERSION)); + $reg = 'Client API version.*' . pcre_quote($db->getAttribute(PDO::ATTR_CLIENT_VERSION), '/'); - if (false === stristr($tmp, $expected)) { + if (!preg_match("/$reg/", $tmp)) { printf("[001] Cannot find MySQL PDO driver line in phpinfo() output\n"); } |