xref: /PHP-8.2/ext/phar/tests/tar/links.phpt (revision 74859783)
1--TEST--
2Phar: tar with hard link and symbolic link
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.tar';
10copy(__DIR__ . '/files/links.tar', $fname);
11try {
12    $p = new PharData($fname);
13} catch (Exception $e) {
14    echo $e->getMessage() . "\n";
15}
16var_dump($p['testit/link']->getContent());
17var_dump($p['testit/hard']->getContent());
18var_dump($p['testit/file']->getContent());
19$p['testit/link'] = 'overwriting';
20var_dump($p['testit/link']->getContent());
21?>
22--CLEAN--
23<?php
24unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar');
25?>
26--EXPECT--
27string(3) "hi
28"
29string(3) "hi
30"
31string(3) "hi
32"
33string(11) "overwriting"
34