Skip to content

Commit 040b5e7

Browse files
committed
Fix posix test
1 parent bfdbb90 commit 040b5e7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ext/posix/tests/posix_ttyname_error_wrongparams.phpt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@ PHP Testfest Berlin 2009-05-10
1212
if (!extension_loaded('posix')) {
1313
die('SKIP - POSIX extension not available');
1414
}
15-
if (!extension_loaded('sockets')) {
16-
die('SKIP - Sockets extension not available');
15+
if (!extension_loaded('standard')) {
16+
die('SKIP - Standard extension not available');
1717
}
1818
?>
1919
--FILE--
2020
<?php
21+
2122
var_dump(posix_ttyname(0)); // param not a resource
23+
24+
$descriptors = [["pty"], ["pty"], ["pty"], ["pipe", "w"]];
25+
$pipes = [];
26+
$process = proc_open('echo "foo";', $descriptors, $pipes);
27+
2228
try {
23-
var_dump(posix_ttyname(finfo_open(FILEINFO_NONE, __DIR__))); // wrong resource type
29+
var_dump(posix_ttyname($process)); // wrong resource type
2430
} catch (TypeError $e) {
2531
echo $e->getMessage(), "\n";
2632
}

0 commit comments

Comments
 (0)