Annotation of embedaddon/php/ext/mysqli/tests/mysqli_thread_id.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mysqli_thread_id()
! 3: --SKIPIF--
! 4: <?php
! 5: require_once('skipif.inc');
! 6: require_once('skipifemb.inc');
! 7: require_once('skipifconnectfailure.inc');
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: require_once("connect.inc");
! 12:
! 13: $tmp = NULL;
! 14: $link = NULL;
! 15:
! 16: if (!is_null($tmp = @mysqli_thread_id()))
! 17: printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 18:
! 19: if (!is_null($tmp = @mysqli_thread_id($link)))
! 20: printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 21:
! 22: require('table.inc');
! 23:
! 24: if (!is_int($tmp = mysqli_thread_id($link)) || (0 === $tmp))
! 25: printf("[003] Expecting int/any but zero, got %s/%s. [%d] %s\n",
! 26: gettype($tmp), $tmp, mysqli_errno($link), mysqli_error($link));
! 27:
! 28: // should work if the thread id is correct
! 29: mysqli_kill($link, mysqli_thread_id($link));
! 30:
! 31: mysqli_close($link);
! 32:
! 33: if (NULL !== ($tmp = mysqli_thread_id($link)))
! 34: printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
! 35:
! 36: print "done!";
! 37: ?>
! 38: --CLEAN--
! 39: <?php
! 40: require_once("clean_table.inc");
! 41: ?>
! 42: --EXPECTF--
! 43: Warning: mysqli_thread_id(): Couldn't fetch mysqli in %s on line %d
! 44: done!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>