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