com php-src: Fix posix test: ext/posix/tests/posix_ttyname_ error_wrongparams.phpt

From: Date: Tue, 04 Aug 2020 07:11:55 +0000
Subject: com php-src: Fix posix test: ext/posix/tests/posix_ttyname_ error_wrongparams.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-112529@lists.php.net to get a copy of this message
Commit: 040b5e727ae6865936b380256cb208ae7be5ece7 Author: Máté Kocsis <kocsismate@woohoolabs.com> Tue, 4 Aug 2020 09:11:43 +0200 Parents: bfdbb90d307a1b87672e0e5f8cf43801b7fa0981 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=040b5e727ae6865936b380256cb208ae7be5ece7 Log: Fix posix test Changed paths: M ext/posix/tests/posix_ttyname_error_wrongparams.phpt Diff: 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"; }

« previous php.cvs (#112529) next »