2012-08-24 08:57:38 +00:00
|
|
|
<?php
|
2012-08-23 19:35:17 +00:00
|
|
|
|
2012-08-24 08:57:38 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2012-08-27 07:33:04 +00:00
|
|
|
namespace Composer\Test\Package\Archiver;
|
2012-08-24 08:57:38 +00:00
|
|
|
|
2012-08-27 07:33:04 +00:00
|
|
|
use Composer\Package\Archiver\TarArchiver;
|
2012-08-24 08:57:38 +00:00
|
|
|
|
2012-08-23 19:35:17 +00:00
|
|
|
/**
|
|
|
|
* @author Till Klampaeckel <till@php.net>
|
|
|
|
* @author Matthieu Moquet <matthieu@moquet.net>
|
|
|
|
*/
|
2012-08-27 07:33:04 +00:00
|
|
|
class TarArchiverTest extends ArchiverTest
|
2012-08-24 08:57:38 +00:00
|
|
|
{
|
2012-08-23 19:35:17 +00:00
|
|
|
public function testArchive()
|
2012-08-24 08:57:38 +00:00
|
|
|
{
|
|
|
|
$this->setupGitRepo();
|
2012-08-23 19:35:17 +00:00
|
|
|
|
2012-08-24 08:57:38 +00:00
|
|
|
$package = $this->setupPackage();
|
2012-08-23 19:35:17 +00:00
|
|
|
$target = sys_get_temp_dir().'/composer_archiver_test.tar';
|
2012-08-24 08:57:38 +00:00
|
|
|
|
2012-08-23 19:35:17 +00:00
|
|
|
// Test archive
|
|
|
|
$archiver = new TarArchiver();
|
|
|
|
$archiver->archive($package->getSourceUrl(), $target);
|
|
|
|
$this->assertFileExists($target);
|
2012-08-24 08:57:38 +00:00
|
|
|
|
2012-08-23 19:35:17 +00:00
|
|
|
unlink($target);
|
2012-08-24 08:57:38 +00:00
|
|
|
$this->removeGitRepo();
|
|
|
|
}
|
|
|
|
}
|