Return to file_get_contents_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file |
1.1 misho 1: --TEST-- 2: file_get_contents() function : basic functionality 3: --CREDITS-- 4: Dave Kelsey <d_kelsey@uk.ibm.com> 5: --FILE-- 6: <?php 7: 8: /* Prototype: string file_get_contents( string $filename[, bool $use_include_path[, 9: * resource $context[, int $offset[, int $maxlen]]]] ) 10: * Description: Reads entire file into a string 11: */ 12: 13: $file_path = dirname(__FILE__); 14: include($file_path."/file.inc"); 15: 16: echo "*** Testing the basic functionality of the file_get_contents() function ***\n"; 17: 18: echo "-- Testing with simple valid data file --\n"; 19: 20: 21: create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte"); 22: var_dump( file_get_contents($file_path."/file1.tmp") ); 23: delete_files($file_path, 1); 24: 25: echo "\n-- Testing with empty file --\n"; 26: 27: create_files($file_path, 1, "empty", 0755, 100, "w", "file", 1, "byte"); 28: var_dump( file_get_contents($file_path."/file1.tmp") ); 29: delete_files($file_path, 1); 30: 31: echo "\n*** Done ***"; 32: ?> 33: --EXPECTF-- 34: *** Testing the basic functionality of the file_get_contents() function *** 35: -- Testing with simple valid data file -- 36: string(100) "text text text text text text text text text text text text text text text text text text text text " 37: 38: -- Testing with empty file -- 39: string(0) "" 40: 41: *** Done ***