1--TEST--
2Test file_get_contents() function : variation - linked files
3--CREDITS--
4Dave Kelsey <d_kelsey@uk.ibm.com>
5--SKIPIF--
6<?php
7if(substr(PHP_OS, 0, 3) == "WIN")
8  die("skip Do not run on Windows");
9?>
10--FILE--
11<?php
12echo "*** Testing file_get_contents() : variation ***\n";
13$filename = __DIR__.'/fileGetContentsVar9.tmp';
14$softlink = __DIR__.'/fileGetContentsVar9.SoftLink';
15$hardlink = __DIR__.'/fileGetContentsVar9.HardLink';
16$chainlink = __DIR__.'/fileGetContentsVar9.ChainLink';
17
18// create file
19$h = fopen($filename,"w");
20//Data should be more than the size of a link.
21for ($i = 1; $i <= 10; $i++) {
22   fwrite($h, "Here is a repeated amount of data");
23}
24fclose($h);
25
26// link files
27link($filename, $hardlink);
28symlink($filename, $softlink);
29symlink($softlink, $chainlink);
30
31// perform tests
32var_dump(file_get_contents($chainlink));
33var_dump(file_get_contents($softlink));
34var_dump(file_get_contents($hardlink));
35
36unlink($chainlink);
37unlink($softlink);
38unlink($hardlink);
39unlink($filename);
40
41echo "\n*** Done ***\n";
42?>
43--EXPECT--
44*** Testing file_get_contents() : variation ***
45string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data"
46string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data"
47string(330) "Here is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of dataHere is a repeated amount of data"
48
49*** Done ***
50