finfo_close_basic.phpt 842 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test finfo_close() function : basic functionality
  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. echo "*** Testing finfo_close() : basic functionality ***\n";
  13. $magicFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'magic';
  14. $finfo = finfo_open( FILEINFO_MIME, $magicFile );
  15. var_dump( $finfo );
  16. // Calling finfo_close() with all possible arguments
  17. var_dump( finfo_close($finfo) );
  18. $finfo = new finfo( FILEINFO_MIME, $magicFile );
  19. var_dump( $finfo );
  20. unset( $finfo );
  21. ?>
  22. ===DONE===
  23. --EXPECTF--
  24. *** Testing finfo_close() : basic functionality ***
  25. resource(%d) of type (file_info)
  26. bool(true)
  27. object(finfo)#%d (%d) {
  28. }
  29. ===DONE===