Annotation of embedaddon/php/ext/mysql/tests/mysql_thread_id.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mysql_thread_id()
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: require_once('skipifconnectfailure.inc');
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10: include_once "connect.inc";
! 11:
! 12: $tmp = NULL;
! 13: $link = NULL;
! 14:
! 15: if (!is_null($tmp = @mysql_thread_id($link)))
! 16: printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 17:
! 18: require('table.inc');
! 19:
! 20: if (!is_int($id = mysql_thread_id($link)) || (0 === $id))
! 21: printf("[002] Expecting int/any but zero, got %s/%s. [%d] %s\n",
! 22: gettype($id), $id, mysql_errno($link), mysql_error($link));
! 23:
! 24: if (!is_int($id_def = mysql_thread_id()) || (0 === $id_def))
! 25: printf("[003] Expecting int/any but zero, got %s/%s. [%d] %s\n",
! 26: gettype($id_def), $id_def, mysql_errno(), mysql_error());
! 27:
! 28: assert($id === $id_def);
! 29:
! 30: mysql_close($link);
! 31:
! 32: if (false !== ($tmp = mysql_thread_id($link)))
! 33: printf("[003] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
! 34:
! 35: print "done!";
! 36: ?>
! 37: --EXPECTF--
! 38: Warning: mysql_thread_id(): %d is not a valid MySQL-Link resource in %s on line %d
! 39: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>