Finish tar, tar.gz, tar.bz2 and tests
modifié: core/lib/Thelia/Config/Resources/config.xml modifié: core/lib/Thelia/Core/FileFormat/Archive/AbstractArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilder.php nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarBz2ArchiveBuilder.php nouveau fichier: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarGzArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilder.php modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilderInterface.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilderTest.php nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarBz2ArchiveBuilderTest.php nouveau fichier: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarGzArchiveBuilderTest.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/ZipArchiveBuilderTest.php
This commit is contained in:
@@ -381,9 +381,8 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testLoadValidArchive()
|
||||
{
|
||||
$tar = TarArchiveBuilder::loadArchive(
|
||||
__DIR__ . DS . "TestResources/well_formatted.tar",
|
||||
"dev"
|
||||
$tar = $this->tar->loadArchive(
|
||||
__DIR__ . DS . "TestResources/well_formatted.tar"
|
||||
);
|
||||
|
||||
$this->assertInstanceOf(
|
||||
@@ -401,9 +400,8 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadInvalidArchive()
|
||||
{
|
||||
$tar = TarArchiveBuilder::loadArchive(
|
||||
__DIR__ . DS . "TestResources/bad_formatted.tar",
|
||||
"dev"
|
||||
$tar = $this->tar->loadArchive(
|
||||
__DIR__ . DS . "TestResources/bad_formatted.tar"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -512,5 +510,17 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->tar->formatFilePath("//foo/bar///baz/")
|
||||
);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
>>>>>>> Finish Tar archive builder
|
||||
=======
|
||||
|
||||
public function testCompression()
|
||||
{
|
||||
$this->assertEquals(
|
||||
null,
|
||||
$this->tar->getCompression()
|
||||
);
|
||||
}
|
||||
}
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
|
||||
@@ -35,4 +35,8 @@ class TarBz2ArchiveBuilderTest extends TarArchiveBuilderTest
|
||||
$this->tar->getCompression()
|
||||
);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
|
||||
namespace Thelia\Tests\FileFormat\Archive\ArchiveBuilder;
|
||||
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarGzArchiveBuilder;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
use Thelia\Core\HttpFoundation\Response;
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
|
||||
/**
|
||||
* Class TarGzArchiveBuilderTest
|
||||
@@ -35,4 +39,8 @@ class TarGzArchiveBuilderTest extends TarArchiveBuilderTest
|
||||
$this->tar->getCompression()
|
||||
);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
|
||||
@@ -40,6 +40,7 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->zip = new ZipArchiveBuilder();
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->zip->setEnvironment("dev");
|
||||
|
||||
@@ -50,6 +51,12 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip",
|
||||
"dev"
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
$this->zip->setEnvironment("dev");
|
||||
|
||||
$this->loadedZip = $this->zip->loadArchive(
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip"
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
@@ -342,12 +349,16 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
public function testLoadValidZip()
|
||||
{
|
||||
$loadedZip = $this->zip->loadArchive(
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip"
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip",
|
||||
"dev"
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip"
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
|
||||
$this->assertInstanceOf(
|
||||
@@ -371,12 +382,16 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
public function testLoadNotValidZip()
|
||||
{
|
||||
$this->zip->loadArchive(
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
__DIR__ . DS . "TestResources/bad_formatted.zip"
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/bad_formatted.zip",
|
||||
"dev"
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/bad_formatted.zip"
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
@@ -386,17 +401,22 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
public function testLoadNotExistingFile()
|
||||
{
|
||||
$this->zip->loadArchive(
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
__DIR__ . DS . "TestResources/this_file_doesn_t_exist.zip"
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/this_file_doesn_t_exist.zip",
|
||||
"dev"
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
__DIR__ . DS . "TestResources/this_file_doesn_t_exist.zip"
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
public function testLoadOnlineAvailableAndValidFile()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
@@ -410,6 +430,13 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
true,
|
||||
FakeFileDownloader::getInstance()
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
$this->zip->loadArchive(
|
||||
__DIR__ . DS . "TestResources/well_formatted.zip",
|
||||
true
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
@@ -427,6 +454,7 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadOnlineAvailableAndNotValidFile()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
@@ -440,6 +468,13 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
true,
|
||||
FakeFileDownloader::getInstance()
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
$this->zip->loadArchive(
|
||||
__DIR__ . DS . "TestResources/bad_formatted.zip",
|
||||
true
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
@@ -448,6 +483,7 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testLoadOnlineNotExistingFile()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
@@ -461,6 +497,13 @@ class ZipArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
true,
|
||||
FakeFileDownloader::getInstance()
|
||||
>>>>>>> Define archive builders and formatters
|
||||
=======
|
||||
$this->zip->setFileDownloader(FakeFileDownloader::getInstance());
|
||||
|
||||
$this->zip->loadArchive(
|
||||
__DIR__ . DS . "TestResources/this_file_doesn_t_exist.zip",
|
||||
true
|
||||
>>>>>>> Finish tar, tar.gz, tar.bz2 and tests
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user