List:Commits« Previous MessageNext Message »
From:ahristov Date:June 26 2007 8:07am
Subject:PHP mysqlnd svn commit: r486 - trunk/tests/ext/mysqli
View as plain text  
Author: ahristov
Date: 2007-06-26 10:07:26 +0200 (Tue, 26 Jun 2007)
New Revision: 486

Modified:
   trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt
Log:
Use three-byte utf8 sequences, this should increase the coverage.


Modified: trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt
===================================================================
--- trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt	2007-06-26 07:29:38 UTC
(rev 485)
+++ trunk/tests/ext/mysqli/mysqli_real_escape_string_unicode.phpt	2007-06-26 08:07:26 UTC
(rev 486)
@@ -38,7 +38,7 @@
 		printf("[008] Expecting \\r, got %s\n", $tmp);
 
 	if ("иху\\0аху" !== ($tmp = mysqli_real_escape_string($link, "иху" . chr(0) .
"аху")))
-		printf("[009] Expecting %s, got %s\n", "foo\\0bar", $tmp);
+		printf("[009] Expecting %s, got %s\n", "иху\\0аху", $tmp);
 
 	if (($exp='абра\\\\ка\"да\\'."'".'бра\Zсим\\nсала\\rби\\0м') !==
 		($tmp = mysqli_real_escape_string($link,
"абра\\ка\"да'бра\032сим\nсала\rби" . chr(0) . "м")))
@@ -46,11 +46,35 @@
 		printf("[010] Expecting %s, got %s\n", $exp, $tmp, var_dump($exp, $tmp));
 	}
 
+	if ('富\\\\酒吧' !== ($tmp = mysqli_real_escape_string($link, '富\\酒吧')))
+		printf("[011] Expecting 富\\\\酒吧, got %s\n", $tmp);
 
+	if ('酒吧\"小题大做' !== ($tmp = mysqli_real_escape_string($link,
'酒吧"小题大做')))
+		printf("[012] Expecting 酒吧\"小题大做, got %s\n", $tmp);
+
+	if ("拉拉\'西雅图" !== ($tmp = mysqli_real_escape_string($link,
"拉拉'西雅图")))
+		printf("[013] Expecting 拉拉'西雅图, got %s\n", $tmp); 
+
+	if ("阿卜拉\\n轻" !== ($tmp = mysqli_real_escape_string($link, "阿卜拉\n轻")))
+		printf("[014] Expecting 阿卜拉\\n轻, got %s\n", $tmp);
+
+	if ("张明安\\r在" !== ($tmp = mysqli_real_escape_string($link, "张明安\r在")))
+		printf("[015] Expecting 张明安\\r在, got %s\n", $tmp);
+
+	if ("竺可桢\\0空调器" !== ($tmp = mysqli_real_escape_string($link, "竺可桢" .
chr(0) . "空调器")))
+		printf("[016] Expecting %s, got %s\n", "竺可桢\\0空调器", $tmp);
+
+	if (($exp='阿卜拉\\\\嘉\"达丰\\'."'".'乳罩\Z辛\\n萨拉\\r毕\\0米') !==
+		($tmp = mysqli_real_escape_string($link,
"阿卜拉\\嘉\"达丰'乳罩\032辛\n萨拉\r毕" . chr(0) . "米")))
+	{
+		printf("[017] Expecting %s, got %s\n", $exp, $tmp, var_dump($exp, $tmp));
+	}
+
+
 	mysqli_close($link);
 
 	if (NULL !== ($tmp = mysqli_real_escape_string($link, 'foo')))
-		printf("[015] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
+		printf("[018] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
 	
 	print "done!";
 ?>

Thread
PHP mysqlnd svn commit: r486 - trunk/tests/ext/mysqliahristov26 Jun