Annotation of embedaddon/php/ext/posix/tests/posix_ttyname_error_wrongparams.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test posix_ttyname() with wrong parameters
                      3: --DESCRIPTION--
                      4: Gets the absolute path to the current terminal device that is open on a given file descriptor.
                      5: Source code: ext/posix/posix.c
                      6: --CREDITS--
                      7: Falko Menge, mail at falko-menge dot de
                      8: PHP Testfest Berlin 2009-05-10
                      9: --SKIPIF--
                     10: <?php 
                     11:        if (!extension_loaded('posix')) { 
                     12:         die('SKIP - POSIX extension not available');
                     13:     }
                     14:        if (!extension_loaded('gd')) { 
                     15:         die('SKIP - GD extension not available');
                     16:     }
                     17:     if (!function_exists('imagecreate')) {
                     18:         die('SKIP - Function imagecreate() not available');
                     19:     }
                     20: ?>
                     21: --FILE--
                     22: <?php
                     23:     var_dump(posix_ttyname()); // param missing
                     24:     var_dump(posix_ttyname(0)); // param not a ressource
                     25:     var_dump(posix_ttyname(imagecreate(1, 1))); // wrong resource type
                     26: ?>
                     27: ===DONE===
                     28: --EXPECTF--
                     29: Warning: posix_ttyname() expects exactly 1 parameter, 0 given in %s on line %d
                     30: bool(false)
                     31: bool(false)
                     32: 
                     33: Warning: posix_ttyname(): supplied resource is not a valid stream resource in %s on line %s
                     34: 
                     35: Warning: posix_ttyname(): expects argument 1 to be a valid stream resource in %s on line %d
                     36: bool(false)
                     37: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>