
| Current Path : /var/www/html/c12park/vendor/pear/archive_tar/tests/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/vendor/pear/archive_tar/tests/create.phpt |
--TEST--
tests basic creation of tarballs
--SKIPIF--
--FILE--
<?php
require_once dirname(__FILE__) . '/setup.php.inc';
$tar = new Archive_Tar(dirname(__FILE__) . '/no_compression.tar');
$tar->add(array(__FILE__));
$content = $tar->listContent();
$discovered_self = false;
foreach ($content as $item) {
if ($item['filename'] === __FILE__) {
$discovered_self = true;
break;
}
}
$phpunit->assertTrue($discovered_self, 'found the file in the uncompressed archive');
unlink(dirname(__FILE__) . '/no_compression.tar');
$tar_gz = new Archive_Tar(dirname(__FILE__) . '/gzip.tar.gz', 'gz');
$tar_gz->add(array(__FILE__));
$content = $tar_gz->listContent();
$discovered_self = false;
foreach ($content as $item) {
if ($item['filename'] === __FILE__) {
$discovered_self = true;
break;
}
}
$phpunit->assertTrue($discovered_self, 'found the file in the gzipped archive');
unlink(dirname(__FILE__) . '/gzip.tar.gz');
echo 'tests done';
?>
--CLEAN--
--EXPECT--
tests done