Fix FileDownloader test
modifié: core/lib/Thelia/Core/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilder.php modifié: core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilder/TarArchiveBuilderTest.php modifié: core/lib/Thelia/Tools/FileDownload/FileDownloader.php modifié: core/lib/Thelia/Tools/URL.php
This commit is contained in:
@@ -33,19 +33,26 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
Tlog::getNewInstance();
|
||||
|
||||
$this->tar = new TarArchiveBuilder();
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->tar->setEnvironment("dev");
|
||||
=======
|
||||
>>>>>>> Finish implementing and testing zip
|
||||
=======
|
||||
$this->tar->setEnvironment("dev");
|
||||
>>>>>>> Fix FileDownloader test
|
||||
}
|
||||
|
||||
public function testAddFileAndDirectory()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$this->tar->setEnvironment("dev");
|
||||
|
||||
>>>>>>> Finish implementing and testing zip
|
||||
=======
|
||||
>>>>>>> Fix FileDownloader test
|
||||
/**
|
||||
* File
|
||||
*/
|
||||
@@ -97,9 +104,13 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testAddValidFileFromString()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
$this->tar->addFileFromString(
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
$this->tar->addFileFromString(
|
||||
>>>>>>> Fix FileDownloader test
|
||||
"foo", "bar"
|
||||
);
|
||||
|
||||
@@ -111,6 +122,7 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
"foo",
|
||||
$this->tar->getFileContent("bar")
|
||||
);
|
||||
<<<<<<< HEAD
|
||||
|
||||
$this->tar->addFileFromString(
|
||||
"foo", "bar", "baz"
|
||||
@@ -308,8 +320,60 @@ class TarArchiveBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
>>>>>>> Finish implementing and testing zip
|
||||
=======
|
||||
=======
|
||||
>>>>>>> Fix FileDownloader test
|
||||
=======
|
||||
>>>>>>> Fix FileDownloader test
|
||||
|
||||
$this->tar->addFileFromString(
|
||||
"foo", "bar", "baz"
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
$this->tar->hasFile("baz/bar")
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
"foo",
|
||||
$this->tar->getFileContent("baz/bar")
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \ErrorException
|
||||
*/
|
||||
public function testAddNotValidFileFromString()
|
||||
{
|
||||
$this->tar->addFileFromString(
|
||||
"foo", $this
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \ErrorException
|
||||
*/
|
||||
public function testAddNotValidFileValueFromString()
|
||||
{
|
||||
$this->tar->addFileFromString(
|
||||
$this, "foo"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function testDeleteFile()
|
||||
{
|
||||
$this->tar->addFileFromString(
|
||||
"foo", "bar"
|
||||
);
|
||||
|
||||
$this->assertTrue(
|
||||
$this->tar->hasFile("bar")
|
||||
);
|
||||
|
||||
$this->tar->deleteFile("bar");
|
||||
|
||||
$this->assertFalse(
|
||||
$this->tar->hasFile("bar")
|
||||
);
|
||||
}
|
||||
}
|
||||
>>>>>>> Complete zip tests
|
||||
|
||||
Reference in New Issue
Block a user