Annotation of embedaddon/php/ext/standard/tests/general_functions/getservbyport_variation1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test function getservbyport() by calling it more than or less than its expected arguments
! 3: --DESCRIPTION--
! 4: Test function passing invalid port number and invalid protocol name
! 5: --CREDITS--
! 6: Italian PHP TestFest 2009 Cesena 19-20-21 june
! 7: Fabio Fabbrucci (fabbrucci@grupporetina.com)
! 8: Michele Orselli (mo@ideato.it)
! 9: Simone Gentili (sensorario@gmail.com)
! 10: --FILE--
! 11: <?php
! 12: var_dump(getservbyport( -1, "tcp" ));
! 13: var_dump(getservbyport( 80, "ppp" ));
! 14: var_dump(getservbyport( null, null));
! 15: var_dump(getservbyport( array(), array()));
! 16: var_dump(getservbyport( array(80), array("tcp")));
! 17: var_dump(getservbyport( array(2, 3), array("one"=>1, "two"=>2)));
! 18: var_dump(getservbyport( 2, 2));
! 19: var_dump(getservbyport( "80", "tcp"));
! 20: var_dump(getservbyport( new stdClass(), new stdClass()));
! 21:
! 22: ?>
! 23: --EXPECTF--
! 24: bool(false)
! 25: bool(false)
! 26: bool(false)
! 27:
! 28: Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
! 29: NULL
! 30:
! 31: Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
! 32: NULL
! 33:
! 34: Warning: getservbyport() expects parameter 1 to be long, array given in %s on line %d
! 35: NULL
! 36: bool(false)
! 37: string(%d) "%s"
! 38:
! 39: Warning: getservbyport() expects parameter 1 to be long, object given in %s on line %d
! 40: NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>