summaryrefslogtreecommitdiff
path: root/ext/sysvshm/tests/001.phpt
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/sysvshm/tests/001.phpt
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/sysvshm/tests/001.phpt')
-rw-r--r--ext/sysvshm/tests/001.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt
new file mode 100644
index 0000000..4b1525b
--- /dev/null
+++ b/ext/sysvshm/tests/001.phpt
@@ -0,0 +1,44 @@
+--TEST--
+ftok() tests
+--SKIPIF--
+<?php if (!extension_loaded("sysvshm")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(ftok());
+var_dump(ftok(1));
+var_dump(ftok(1,1,1));
+
+var_dump(ftok("",""));
+var_dump(ftok(-1, -1));
+var_dump(ftok("qwertyu","qwertyu"));
+
+var_dump(ftok("nonexistentfile","q"));
+
+var_dump(ftok(__FILE__,"q"));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: ftok() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: ftok() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: ftok() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: ftok(): Pathname is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): Project identifier is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): Project identifier is invalid in %s on line %d
+int(-1)
+
+Warning: ftok(): ftok() failed - No such file or directory in %s on line %d
+int(-1)
+int(%d)
+Done