"Fossies" - the Fresh Open Source Software Archive

Member "php-7.4.1/ext/sysvshm/tests/001.phpt" (17 Dec 2019, 940 Bytes) of package /linux/www/php-7.4.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 ftok() tests
    3 --SKIPIF--
    4 <?php
    5 if (!extension_loaded("sysvshm")){ print 'skip'; }
    6 if (!function_exists('ftok')){ print 'skip'; }
    7 ?>
    8 --FILE--
    9 <?php
   10 
   11 var_dump(ftok());
   12 var_dump(ftok(1));
   13 var_dump(ftok(1,1,1));
   14 
   15 var_dump(ftok("",""));
   16 var_dump(ftok(-1, -1));
   17 var_dump(ftok("qwertyu","qwertyu"));
   18 
   19 var_dump(ftok("nonexistentfile","q"));
   20 
   21 var_dump(ftok(__FILE__,"q"));
   22 
   23 echo "Done\n";
   24 ?>
   25 --EXPECTF--
   26 Warning: ftok() expects exactly 2 parameters, 0 given in %s on line %d
   27 NULL
   28 
   29 Warning: ftok() expects exactly 2 parameters, 1 given in %s on line %d
   30 NULL
   31 
   32 Warning: ftok() expects exactly 2 parameters, 3 given in %s on line %d
   33 NULL
   34 
   35 Warning: ftok(): Pathname is invalid in %s on line %d
   36 int(-1)
   37 
   38 Warning: ftok(): Project identifier is invalid in %s on line %d
   39 int(-1)
   40 
   41 Warning: ftok(): Project identifier is invalid in %s on line %d
   42 int(-1)
   43 
   44 Warning: ftok(): ftok() failed - No such file or directory in %s on line %d
   45 int(-1)
   46 int(%d)
   47 Done