Refactor ImportExportControllerBase into a trait and finish ProductStockImportTest

modifié:         core/lib/Thelia/Tests/Controller/ImportControllerTest.php
	renommé:         core/lib/Thelia/Tests/Controller/ImportExportControllerTest.php -> core/lib/Thelia/Tests/Controller/ImportExportControllerTrait.php
	modifié:         core/lib/Thelia/Tests/ImportExport/Import/ProductStockImportTest.php
This commit is contained in:
Benjamin Perche
2014-07-21 10:42:25 +02:00
parent 14cf745a89
commit 853c74edb2
3 changed files with 17 additions and 3 deletions

View File

@@ -19,14 +19,15 @@ use Thelia\Core\FileFormat\Formatting\FormatterManagerTrait;
use Thelia\Core\FileFormat\FormatType; use Thelia\Core\FileFormat\FormatType;
/** /**
* Class ImportControllerTest * Class ImportControllerTrait
* @package Thelia\Tests\Controller * @package Thelia\Tests\Controller
* @author Benjamin Perche <bperche@openstudio.fr> * @author Benjamin Perche <bperche@openstudio.fr>
*/ */
class ImportControllerTest extends ImportExportControllerTest class ImportControllerTrait extends ControllerTestBase
{ {
use FormatterManagerTrait; use FormatterManagerTrait;
use ArchiveBuilderManagerTrait; use ArchiveBuilderManagerTrait;
use ImportExportControllerTrait;
/** /**
* @return \Thelia\Controller\BaseController The controller you want to test * @return \Thelia\Controller\BaseController The controller you want to test

View File

@@ -27,7 +27,7 @@ use Thelia\Core\FileFormat\Formatting\FormatterManager;
* @package Thelia\Tests\Controller * @package Thelia\Tests\Controller
* @author Benjamin Perche <bperche@openstudio.fr> * @author Benjamin Perche <bperche@openstudio.fr>
*/ */
abstract class ImportExportControllerTest extends ControllerTestBase trait ImportExportControllerTrait
{ {
/** /**

View File

@@ -11,10 +11,12 @@
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Tests\ImportExport\Import; namespace Thelia\Tests\ImportExport\Import;
use Thelia\Controller\Admin\ImportController;
use Thelia\Core\FileFormat\Formatting\Formatter\JsonFormatter; use Thelia\Core\FileFormat\Formatting\Formatter\JsonFormatter;
use Thelia\ImportExport\Import\Type\ProductStockImport; use Thelia\ImportExport\Import\Type\ProductStockImport;
use Thelia\Model\ProductSaleElementsQuery; use Thelia\Model\ProductSaleElementsQuery;
use Thelia\Tests\Controller\ControllerTestBase; use Thelia\Tests\Controller\ControllerTestBase;
use Thelia\Tests\Controller\ImportExportControllerTrait;
/** /**
* Class ProductStockControllerTest * Class ProductStockControllerTest
@@ -23,6 +25,17 @@ use Thelia\Tests\Controller\ControllerTestBase;
*/ */
class ProductStockControllerTest extends ControllerTestBase class ProductStockControllerTest extends ControllerTestBase
{ {
use ImportExportControllerTrait;
/**
* @return \Thelia\Controller\BaseController The controller you want to test
*/
protected function getController()
{
return new ImportController();
}
public function setUp() public function setUp()
{ {
parent::setUp(); parent::setUp();