summaryrefslogtreecommitdiff
path: root/ext/sysvshm/tests/001.phpt
blob: e9d00bc6dc24c24b0c97c1e7d643191f9f41d35f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
ftok() tests
--SKIPIF--
<?php
if (!extension_loaded("sysvshm")){ print 'skip'; }
if (!function_exists('ftok')){ print 'skip'; }
?>
--FILE--
<?php

try {
    ftok("","");
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

try {
    ftok(-1, -1);
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

try {
    ftok("qwertyu","qwertyu");
} catch (\ValueError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

var_dump(ftok("nonexistentfile","q"));

var_dump(ftok(__FILE__,"q"));

echo "Done\n";
?>
--EXPECTF--
ftok(): Argument #1 ($pathname) cannot be empty
ftok(): Argument #2 ($proj) must be a single character
ftok(): Argument #2 ($proj) must be a single character

Warning: ftok(): ftok() failed - No such file or directory in %s on line %d
int(-1)
int(%d)
Done