Author: uwendel
Date: 2007-07-03 18:38:04 +0200 (Tue, 03 Jul 2007)
New Revision: 608
Modified:
trunk/tests/ext/mysql/mysql_error.phpt
Log:
Code coverage: same changes as for mysql_errno(): a) parameter check, b) connect error
check
Modified: trunk/tests/ext/mysql/mysql_error.phpt
===================================================================
--- trunk/tests/ext/mysql/mysql_error.phpt 2007-07-03 16:35:55 UTC (rev 607)
+++ trunk/tests/ext/mysql/mysql_error.phpt 2007-07-03 16:38:04 UTC (rev 608)
@@ -14,6 +14,9 @@
if (false !== ($tmp = @mysql_error($link)))
printf("[002] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+
+ if (!is_null($tmp = @mysql_error($link, 'too many args')))
+ printf("[002b] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***,
dbname=%s, port=%s, socket=%s\n",
@@ -42,6 +45,13 @@
var_dump(mysql_error($link));
+ if ($link = @mysql_connect($host . '_unknown', $user . '_unknown', $passwd, true)) {
+ printf("[008] Can connect to the server using host=%s, user=%s, passwd=***,
dbname=%s, port=%s, socket=%s\n",
+ $host . '_unknown', $user . '_unknown', $db, $port, $socket);
+ }
+ if ('' == mysql_error())
+ printf("[009] Connect error should have been set\n");
+
print "done!";
?>
--EXPECTF--
| Thread |
|---|
| • PHP mysqlnd svn commit: r608 - trunk/tests/ext/mysql | uwendel | 3 Jul |