uw                                       Mon, 12 Sep 2011 15:05:10 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=316550

Log:
This should please gcov.php.net which hits error 1044 instead of 1049.

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_select_db.phpt
    U   php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_select_db.phpt
    U   php/php-src/trunk/ext/mysqli/tests/mysqli_select_db.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_select_db.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_select_db.phpt 
2011-09-12 15:02:54 UTC (rev 316549)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_select_db.phpt 
2011-09-12 15:05:10 UTC (rev 316550)
@@ -70,7 +70,17 @@
        mysqli_report(MYSQLI_REPORT_OFF);
        mysqli_select_db($link, 'I can not imagine that this database exists');
        mysqli_report(MYSQLI_REPORT_ERROR);
+
+       ob_start();
        mysqli_select_db($link, 'I can not imagine that this database exists');
+       $output = ob_get_contents();
+       ob_end_clean();
+       if (!stristr($output, "1049") && !stristr($output, "1044") && 
!stristr($output, "1045")) {
+         /* Error: 1049 SQLSTATE: 42000 (ER_BAD_DB_ERROR) Message: Unknown 
database '%s'  */
+         /* Error: 1044 SQLSTATE: 42000 (ER_DBACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' to database '%s' */
+         /* Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' (using password: %s) */
+         echo $output;
+       }

        if (!$res = mysqli_query($link, "SELECT DATABASE() AS dbname"))
                printf("[015] [%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
@@ -98,7 +108,5 @@
 --CLEAN--
 <?php require_once("clean_table.inc"); ?>
 --EXPECTF--
-Warning: mysqli_select_db(): (%s/%d): Unknown database '%s' in %s on line %d
-
 Warning: mysqli_select_db(): Couldn't fetch mysqli in %s on line %d
 done!
\ No newline at end of file

Modified: php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_select_db.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_select_db.phpt 
2011-09-12 15:02:54 UTC (rev 316549)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_select_db.phpt 
2011-09-12 15:05:10 UTC (rev 316550)
@@ -70,7 +70,17 @@
        mysqli_report(MYSQLI_REPORT_OFF);
        mysqli_select_db($link, 'I can not imagine that this database exists');
        mysqli_report(MYSQLI_REPORT_ERROR);
+
+       ob_start();
        mysqli_select_db($link, 'I can not imagine that this database exists');
+       $output = ob_get_contents();
+       ob_end_clean();
+       if (!stristr($output, "1049") && !stristr($output, "1044") && 
!stristr($output, "1045")) {
+         /* Error: 1049 SQLSTATE: 42000 (ER_BAD_DB_ERROR) Message: Unknown 
database '%s'  */
+         /* Error: 1044 SQLSTATE: 42000 (ER_DBACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' to database '%s' */
+         /* Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' (using password: %s) */
+         echo $output;
+       }

        if (!$res = mysqli_query($link, "SELECT DATABASE() AS dbname"))
                printf("[015] [%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
@@ -98,7 +108,5 @@
 --CLEAN--
 <?php require_once("clean_table.inc"); ?>
 --EXPECTF--
-Warning: mysqli_select_db(): (%s/%d): Unknown database '%s' in %s on line %d
-
 Warning: mysqli_select_db(): Couldn't fetch mysqli in %s on line %d
 done!
\ No newline at end of file

Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_select_db.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/mysqli_select_db.phpt    2011-09-12 
15:02:54 UTC (rev 316549)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_select_db.phpt    2011-09-12 
15:05:10 UTC (rev 316550)
@@ -70,7 +70,17 @@
        mysqli_report(MYSQLI_REPORT_OFF);
        mysqli_select_db($link, 'I can not imagine that this database exists');
        mysqli_report(MYSQLI_REPORT_ERROR);
+
+       ob_start();
        mysqli_select_db($link, 'I can not imagine that this database exists');
+       $output = ob_get_contents();
+       ob_end_clean();
+       if (!stristr($output, "1049") && !stristr($output, "1044") && 
!stristr($output, "1045")) {
+         /* Error: 1049 SQLSTATE: 42000 (ER_BAD_DB_ERROR) Message: Unknown 
database '%s'  */
+         /* Error: 1044 SQLSTATE: 42000 (ER_DBACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' to database '%s' */
+         /* Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: 
Access denied for user '%s'@'%s' (using password: %s) */
+         echo $output;
+       }

        if (!$res = mysqli_query($link, "SELECT DATABASE() AS dbname"))
                printf("[015] [%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
@@ -98,7 +108,5 @@
 --CLEAN--
 <?php require_once("clean_table.inc"); ?>
 --EXPECTF--
-Warning: mysqli_select_db(): (%s/%d): Unknown database '%s' in %s on line %d
-
 Warning: mysqli_select_db(): Couldn't fetch mysqli in %s on line %d
 done!
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to