Annotation of embedaddon/php/ext/standard/tests/general_functions/getservbyname_variation10.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
                      2: Test function getservbyname() by substituting argument 2 with emptyUnsetUndefNull values.
1.1.1.2 ! misho       3: --SKIPIF--
        !             4: <?php
        !             5: if(PHP_OS == 'Darwin') {
        !             6:   die("skip.. Mac OS X is fine with NULLs in getservbyname");
        !             7: }
        !             8: ?>
1.1       misho       9: --FILE--
                     10: <?php
                     11: 
                     12: 
                     13: echo "*** Test substituting argument 2 with emptyUnsetUndefNull values ***\n";
                     14: 
                     15: $service = "www";
                     16: 
                     17: 
                     18: $unset_var = 10;
                     19: unset($unset_var);
                     20: 
                     21: $variation_array = array(
                     22:   'unset var' => @$unset_var,
                     23:   'undefined var' => @$undefined_var,
                     24:   'empty string DQ' => "",
                     25:   'empty string SQ' => '',
                     26:   'uppercase NULL' => NULL,
                     27:   'lowercase null' => null,
                     28:   );
                     29: 
                     30: 
                     31: foreach ( $variation_array as $var ) {
                     32:   var_dump(getservbyname( $service, $var  ) );
                     33: }
                     34: ?>
                     35: --EXPECTF--
                     36: *** Test substituting argument 2 with emptyUnsetUndefNull values ***
                     37: bool(false)
                     38: bool(false)
                     39: bool(false)
                     40: bool(false)
                     41: bool(false)
                     42: bool(false)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>