1--TEST--
2Test posix_ttyname() with wrong parameters
3--DESCRIPTION--
4Gets the absolute path to the current terminal device that is open on a given file descriptor.
5Source code: ext/posix/posix.c
6--CREDITS--
7Falko Menge, mail at falko-menge dot de
8PHP 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--
29Warning: posix_ttyname() expects exactly 1 parameter, 0 given in %s on line %d
30bool(false)
31bool(false)
32
33Warning: posix_ttyname(): supplied resource is not a valid stream resource in %s on line %d
34
35Warning: posix_ttyname(): expects argument 1 to be a valid stream resource in %s on line %d
36bool(false)
37===DONE===
38