public function testArchiveAndExtract()
{
$projectRoot = $this->createDummyProject('tests/data/apps/drupal/project');
// Archiving only works if the repository is a genuine Git directory.
chdir($projectRoot);
exec('git init');
$treeId = $this->builder->getTreeId($projectRoot);
$this->assertNotEmpty($treeId);
// Build. This should create an archive.
$this->builder->build($projectRoot);
$archive = $projectRoot . '/' . self::$config->get('local.archive_dir') . '/' . $treeId . '.tar.gz';
$this->assertFileExists($archive);
// Build again. This will extract the archive.
$success = $this->builder->build($projectRoot);
$this->assertTrue($success);
}