summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-04 09:11:43 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-08-04 09:11:55 +0200
commit040b5e727ae6865936b380256cb208ae7be5ece7 (patch)
tree4b555dd6761a7c3c2f89f750f1ec8a3cca78c389 /ext/posix
parentbfdbb90d307a1b87672e0e5f8cf43801b7fa0981 (diff)
downloadphp-git-040b5e727ae6865936b380256cb208ae7be5ece7.tar.gz
Fix posix test
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/tests/posix_ttyname_error_wrongparams.phpt12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt
index d666516521..98488f68d1 100644
--- a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt
+++ b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt
@@ -12,15 +12,21 @@ PHP Testfest Berlin 2009-05-10
if (!extension_loaded('posix')) {
die('SKIP - POSIX extension not available');
}
- if (!extension_loaded('sockets')) {
- die('SKIP - Sockets extension not available');
+ if (!extension_loaded('standard')) {
+ die('SKIP - Standard extension not available');
}
?>
--FILE--
<?php
+
var_dump(posix_ttyname(0)); // param not a resource
+
+$descriptors = [["pty"], ["pty"], ["pty"], ["pipe", "w"]];
+$pipes = [];
+$process = proc_open('echo "foo";', $descriptors, $pipes);
+
try {
- var_dump(posix_ttyname(finfo_open(FILEINFO_NONE, __DIR__))); // wrong resource type
+ var_dump(posix_ttyname($process)); // wrong resource type
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}