diff --git a/core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php b/core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php index 69fdfdb9a..3cdb600d5 100644 --- a/core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php +++ b/core/lib/Thelia/Tests/FileFormat/Archive/ArchiveBuilderManagerTest.php @@ -39,7 +39,34 @@ class ArchiveBuilderManagerTest extends \PHPUnit_Framework_TestCase public function testAddArchiveBuilder() { /** @var AbstractArchiveBuilder $instance */ - $instance = $this->getMock("Thelia\\Core\\FileFormat\\Archive\\AbstractArchiveBuilder"); + $instance = $this->getMock( + "Thelia\\Core\\FileFormat\\Archive\\AbstractArchiveBuilder", + [ + "isAvailable", + "getName", + "getExtension", + "getMimeType", + "addFile", + "addFileFromString", + "getFileContent", + "deleteFile", + "addDirectory", + "buildArchiveResponse", + "loadArchive", + "hasFile", + "hasDirectory", + ] + ); + + $instance->expects($this->any()) + ->method("isAvailable") + ->willReturn(true) + ; + + $instance->expects($this->any()) + ->method("getName") + ->willReturn("foo") + ; $this->manager->add($instance); @@ -53,7 +80,34 @@ class ArchiveBuilderManagerTest extends \PHPUnit_Framework_TestCase public function testDeleteArchiveBuilder() { /** @var AbstractArchiveBuilder $instance */ - $instance = $this->getMock("Thelia\\Core\\FileFormat\\Archive\\AbstractArchiveBuilder"); + $instance = $this->getMock( + "Thelia\\Core\\FileFormat\\Archive\\AbstractArchiveBuilder", + [ + "isAvailable", + "getName", + "getExtension", + "getMimeType", + "addFile", + "addFileFromString", + "getFileContent", + "deleteFile", + "addDirectory", + "buildArchiveResponse", + "loadArchive", + "hasFile", + "hasDirectory", + ] + ); + + $instance->expects($this->any()) + ->method("isAvailable") + ->willReturn(true) + ; + + $instance->expects($this->any()) + ->method("getName") + ->willReturn("foo") + ; $this->manager->add($instance); diff --git a/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php b/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php index 689dbcee8..1fa104a75 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php @@ -74,7 +74,9 @@ class ProductPricesExportTest extends \PHPUnit_Framework_TestCase $attributes = []; foreach ($attributeCombinations as $attributeCombination) { - $attributes[] = $attributeCombination->getAttributeAv()->getTitle(); + if (!in_array($attributeCombination->getAttributeAv()->getTitle(), $attributes)) { + $attributes[] = $attributeCombination->getAttributeAv()->getTitle(); + } } $rowAttributes = explode(",", $row["attributes"]);