Complete zip tests

modifié:         core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilder.php
	modifié:         core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderInterface.php
	modifié:         core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilderTest.php
	modifié:         core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilderTest.php
This commit is contained in:
Benjamin Perche
2014-07-03 13:38:40 +02:00
parent 83cf3b59e0
commit ee2c383c73
4 changed files with 28 additions and 0 deletions

View File

@@ -121,11 +121,15 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
* Download the file if it is online * Download the file if it is online
* If it's local check if the file exists and if it is redable * If it's local check if the file exists and if it is redable
*/ */
<<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
$fileDownloadCache = $this->cacheDir . DS . md5(uniqid()) . ".tmp"; $fileDownloadCache = $this->cacheDir . DS . md5(uniqid()) . ".tmp";
======= =======
$fileDownloadCache = $this->cacheDir . DS . "download.tmp"; $fileDownloadCache = $this->cacheDir . DS . "download.tmp";
>>>>>>> Finish implementing and testing zip >>>>>>> Finish implementing and testing zip
=======
$fileDownloadCache = $this->cacheDir . DS . md5(uniqid()) . ".tmp";
>>>>>>> Complete zip tests
$this->copyFile($filePath, $fileDownloadCache, $isOnline); $this->copyFile($filePath, $fileDownloadCache, $isOnline);
/** /**
@@ -253,6 +257,7 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
*/ */
public function getFileContent($pathToFile) public function getFileContent($pathToFile)
{ {
<<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
$pathToFile = $this->formatFilePath($pathToFile); $pathToFile = $this->formatFilePath($pathToFile);
@@ -276,6 +281,9 @@ class TarArchiveBuilder extends AbstractArchiveBuilder
======= =======
=======
>>>>>>> Complete zip tests
} }

View File

@@ -18,11 +18,15 @@ use Thelia\Tools\FileDownload\FileDownloaderInterface;
* @package Thelia\Core\FileFormat\Archive * @package Thelia\Core\FileFormat\Archive
* @author Benjamin Perche <bperche@openstudio.fr> * @author Benjamin Perche <bperche@openstudio.fr>
* *
<<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
* This interface defines the methods that an archive builder must have. * This interface defines the methods that an archive builder must have.
======= =======
* This interface defines the methods that an archive creator must have. * This interface defines the methods that an archive creator must have.
>>>>>>> Define archive builders and formatters >>>>>>> Define archive builders and formatters
=======
* This interface defines the methods that an archive builder must have.
>>>>>>> Complete zip tests
*/ */
interface ArchiveBuilderInterface interface ArchiveBuilderInterface
{ {

View File

@@ -91,10 +91,14 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
} }
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> Complete zip tests
public function testAddValidFileFromString() public function testAddValidFileFromString()
{ {
$this->tar->addFileFromString( $this->tar->addFileFromString(
<<<<<<< HEAD
"foo", "bar" "foo", "bar"
); );
@@ -301,3 +305,9 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
======= =======
} }
>>>>>>> Finish implementing and testing zip >>>>>>> Finish implementing and testing zip
=======
)
}
}
>>>>>>> Complete zip tests

View File

@@ -596,6 +596,9 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
$this->loadedZip->getFileContent("bar") $this->loadedZip->getFileContent("bar")
); );
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> Complete zip tests
$this->loadedZip->addFileFromString( $this->loadedZip->addFileFromString(
"foo", "bar", "baz" "foo", "bar", "baz"
@@ -609,8 +612,11 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
"foo", "foo",
$this->loadedZip->getFileContent("baz/bar") $this->loadedZip->getFileContent("baz/bar")
); );
<<<<<<< HEAD
======= =======
>>>>>>> Finish implementing and testing zip >>>>>>> Finish implementing and testing zip
=======
>>>>>>> Complete zip tests
} }
/** /**