1--TEST-- 2Test file_put_contents() and file_get_contents() functions : basic functionality 3--FILE-- 4<?php 5 6$file_path = __DIR__; 7include($file_path."/file.inc"); 8 9echo "*** Testing the basic functionality of file_put_contents() and file_get_contents() functions ***\n"; 10 11echo "-- Testing with simple valid data file --\n"; 12 13$file_name = "/file_put_contents.tmp"; 14fill_buffer($text_buffer, "text", 100); 15file_put_contents( $file_path.$file_name, $text_buffer ); 16 17var_dump( file_get_contents($file_path.$file_name) ); 18 19echo "\n-- Testing with empty file --\n"; 20 21$file_name = "/file_put_contents1.tmp"; 22file_put_contents( $file_path.$file_name, ""); 23var_dump( file_get_contents( $file_path.$file_name ) ); 24 25echo "\n*** Done ***"; 26?> 27--CLEAN-- 28<?php 29$file_path = __DIR__; 30unlink($file_path."/file_put_contents.tmp"); 31unlink($file_path."/file_put_contents1.tmp"); 32?> 33--EXPECT-- 34*** Testing the basic functionality of file_put_contents() and file_get_contents() functions *** 35-- Testing with simple valid data file -- 36string(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 -- 39string(0) "" 40 41*** Done *** 42