summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorZoe Slattery <zoe@php.net>2009-08-28 14:31:19 +0000
committerZoe Slattery <zoe@php.net>2009-08-28 14:31:19 +0000
commit0e4ce3bccac84196ce15f488735b7b8187978744 (patch)
tree972c5f4e245f2a95332b20ce0fd51a79e5ec4424 /ext/posix
parent9bf747605df02a95abb80ad0216a39e9059d54e1 (diff)
downloadphp-git-0e4ce3bccac84196ce15f488735b7b8187978744.tar.gz
More tests from 2009 testfest
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/tests/posix_ctermid_error.phpt19
-rw-r--r--ext/posix/tests/posix_errno_error.phpt24
-rw-r--r--ext/posix/tests/posix_geteuid_error1.phpt37
3 files changed, 80 insertions, 0 deletions
diff --git a/ext/posix/tests/posix_ctermid_error.phpt b/ext/posix/tests/posix_ctermid_error.phpt
new file mode 100644
index 0000000000..a177f54578
--- /dev/null
+++ b/ext/posix/tests/posix_ctermid_error.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Test function posix_ctermid() by calling it more than or less than its expected arguments
+--SKIPIF--
+<?php
+ if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
+?>
+--CREDITS--
+Marco Fabbri mrfabbri@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+
+var_dump( posix_ctermid( 'foo' ) );
+
+?>
+--EXPECTF--
+Warning: posix_ctermid() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
diff --git a/ext/posix/tests/posix_errno_error.phpt b/ext/posix/tests/posix_errno_error.phpt
new file mode 100644
index 0000000000..0a77fb0009
--- /dev/null
+++ b/ext/posix/tests/posix_errno_error.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test function posix_errno() by calling it with its expected arguments
+--SKIPIF--
+<?php
+ if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
+?>
+--CREDITS--
+Morten Amundsen mor10am@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+
+echo "*** Test by calling method or function with more than expected arguments ***\n";
+
+// test without any error
+var_dump(posix_errno('bar'));
+
+?>
+--EXPECTF--
+*** Test by calling method or function with more than expected arguments ***
+
+Warning: posix_errno() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
diff --git a/ext/posix/tests/posix_geteuid_error1.phpt b/ext/posix/tests/posix_geteuid_error1.phpt
new file mode 100644
index 0000000000..ac4e0d5ddc
--- /dev/null
+++ b/ext/posix/tests/posix_geteuid_error1.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Test function posix_geteuid() by calling it more than or less than its expected arguments
+--SKIPIF--
+<?php
+ if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
+?>
+--CREDITS--
+Marco Fabbri mrfabbri@gmail.com
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--FILE--
+<?php
+echo "*** Test by calling method or function with incorrect numbers of arguments ***\n";
+
+$extra_args = array( 12312, 2 => '1234', 'string' => 'string' );
+
+var_dump( posix_geteuid( $extra_args ));
+foreach ( $extra_args as $arg )
+{
+ var_dump(posix_geteuid( $arg ));
+}
+
+?>
+--EXPECTF--
+*** Test by calling method or function with incorrect numbers of arguments ***
+
+Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+
+Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+
+Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
+NULL
+
+Warning: posix_geteuid() expects exactly 0 parameters, 1 given in %s on line %d
+NULL