1--TEST--
2file_get_contents() function : basic functionality
3--CREDITS--
4Dave 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 = __DIR__;
14include($file_path."/file.inc");
15
16echo "*** Testing the basic functionality of the file_get_contents() function ***\n";
17
18echo "-- Testing with simple valid data file --\n";
19
20
21create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte");
22var_dump( file_get_contents($file_path."/file1.tmp") );
23delete_files($file_path, 1);
24
25echo "\n-- Testing with empty file --\n";
26
27create_files($file_path, 1, "empty", 0755, 100, "w", "file", 1, "byte");
28var_dump( file_get_contents($file_path."/file1.tmp") );
29delete_files($file_path, 1);
30
31echo "\n*** Done ***";
32?>
33--EXPECT--
34*** Testing the basic functionality of the file_get_contents() function ***
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