Annotation of embedaddon/php/ext/fileinfo/tests/finfo_close_error.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test finfo_close() function : error conditions 
        !             3: --SKIPIF--
        !             4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
        !             5: --FILE--
        !             6: <?php
        !             7: /* Prototype  : resource finfo_close(resource finfo)
        !             8:  * Description: Close fileinfo resource. 
        !             9:  * Source code: ext/fileinfo/fileinfo.c
        !            10:  * Alias to functions: 
        !            11:  */
        !            12: 
        !            13: echo "*** Testing finfo_close() : error conditions ***\n";
        !            14: 
        !            15: $magicFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'magic';
        !            16: $finfo = finfo_open( FILEINFO_MIME, $magicFile );
        !            17: $fp = fopen( __FILE__, 'r' );
        !            18: 
        !            19: echo "\n-- Testing finfo_close() function with Zero arguments --\n";
        !            20: var_dump( finfo_close() );
        !            21: 
        !            22: echo "\n-- Testing finfo_close() function with more than expected no. of arguments --\n";
        !            23: var_dump( finfo_close( $finfo, '10') );
        !            24: 
        !            25: echo "\n-- Testing finfo_close() function with wrong resource type --\n";
        !            26: var_dump( finfo_close( $fp ) );
        !            27: 
        !            28: ?>
        !            29: ===DONE===
        !            30: --EXPECTF--
        !            31: *** Testing finfo_close() : error conditions ***
        !            32: 
        !            33: -- Testing finfo_close() function with Zero arguments --
        !            34: 
        !            35: Warning: finfo_close() expects exactly 1 parameter, 0 given in %s on line %d
        !            36: bool(false)
        !            37: 
        !            38: -- Testing finfo_close() function with more than expected no. of arguments --
        !            39: 
        !            40: Warning: finfo_close() expects exactly 1 parameter, 2 given in %s on line %d
        !            41: bool(false)
        !            42: 
        !            43: -- Testing finfo_close() function with wrong resource type --
        !            44: 
        !            45: Warning: finfo_close(): supplied resource is not a valid file_info resource in %s on line %d
        !            46: bool(false)
        !            47: ===DONE===

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