]> granicus.if.org Git - php/commitdiff
Whitespace/Coding Standards.
authorUlf Wendel <uw@php.net>
Wed, 11 Jul 2007 12:50:34 +0000 (12:50 +0000)
committerUlf Wendel <uw@php.net>
Wed, 11 Jul 2007 12:50:34 +0000 (12:50 +0000)
Test for default link added.

ext/mysql/tests/mysql_db_query.phpt

index 42698b9268fcbe0265743a4aa8063ff080a018f4..421e9f592dc8df1f9b1bfa28863c1b7af27fc456 100644 (file)
@@ -4,40 +4,55 @@ mysql_db_query()
 <?php require_once('skipif.inc'); ?>
 --FILE--
 <?php
-    include "connect.inc";
-    
-    // NOTE: this function is deprecated. We do only the most necessary 
-    // to test it. We don't test all aspects of the documented behaviour.
-
-    $tmp    = NULL;   
-    $link   = NULL;
-       
-    if (NULL !== ($tmp = @mysql_db_query()))
-        printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
-
-    if (NULL !== ($tmp = @mysql_db_query($link)))
-        printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
-        
-    if (NULL !== ($tmp = @mysql_db_query($link)))
-        printf("[003] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);        
-
-    require('table.inc');    
-    if (!$res = mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1', $link)) 
-        printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link));    
-         
-    $row = mysql_fetch_assoc($res);
-    if (1 != $row['id'])
-        printf("[005] Expecting record 1/a, got record %s/%s\n", $row['id'], $row['label']);
-        
-    if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
-        printf("[006] No unicode returned! [%d] %s\n", mysql_errno($link), mysql_error($link));
-        var_inspect($row);
-    }
-        
-    mysql_free_result($res);   
-    mysql_close($link);
-
-    print "done!\n"; 
+include "connect.inc";
+
+// NOTE: this function is deprecated. We do only the most necessary
+// to test it. We don't test all aspects of the documented behaviour.
+
+$tmp    = NULL;
+$link   = NULL;
+
+if (NULL !== ($tmp = @mysql_db_query()))
+       printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+if (NULL !== ($tmp = @mysql_db_query($link)))
+       printf("[002] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+if (NULL !== ($tmp = @mysql_db_query($link)))
+       printf("[003] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
+
+require('table.inc');
+if (!$res = mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1', $link))
+       printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link));
+
+$row = mysql_fetch_assoc($res);
+if (1 != $row['id'])
+       printf("[005] Expecting record 1/a, got record %s/%s\n", $row['id'], $row['label']);
+
+if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
+       printf("[006] No unicode returned! [%d] %s\n", mysql_errno($link), mysql_error($link));
+       var_inspect($row);
+}
+
+mysql_free_result($res);
+
+
+if (!$res = mysql_db_query($db, 'SELECT id, label FROM test ORDER BY id LIMIT 1'))
+       printf("[007] [%d] %s\n", mysql_errno(), mysql_error());
+
+$row = mysql_fetch_assoc($res);
+if (1 != $row['id'])
+       printf("[008] Expecting record 1/a, got record %s/%s\n", $row['id'], $row['label']);
+
+if (ini_get('unicode.semantics') && !is_unicode($row['label'])) {
+       printf("[009] No unicode returned! [%d] %s\n", mysql_errno(), mysql_error());
+       var_inspect($row);
+}
+
+mysql_free_result($res);
+mysql_close($link);
+
+print "done!\n";
 ?>
 --EXPECTF--
 done!
\ No newline at end of file