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