Define Import controller test

modifié:         core/lib/Thelia/Tests/Controller/ControllerTestBase.php
	nouveau fichier: core/lib/Thelia/Tests/Controller/ImportControllerTest.php
	modifié:         core/lib/Thelia/Tests/Controller/ImportExportControllerTest.php
This commit is contained in:
Benjamin Perche
2014-07-21 09:48:12 +02:00
parent a731873ff3
commit ae750866aa
3 changed files with 36 additions and 5 deletions

View File

@@ -81,11 +81,11 @@ abstract class ControllerTestBase extends \PHPUnit_Framework_TestCase
/** /**
* @return \Thelia\Controller\BaseController The controller you want to test * @return \Thelia\Controller\BaseController The controller you want to test
*/ */
abstract function getController(); abstract protected function getController();
/** /**
* Use this method to build the container with the services that you need. * Use this method to build the container with the services that you need.
*/ */
abstract function buildContainer(ContainerBuilder $container); abstract protected function buildContainer(ContainerBuilder $container);
} }

View File

@@ -0,0 +1,32 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Tests\Controller;
use Thelia\Controller\Admin\ImportController;
/**
* Class ImportControllerTest
* @package Thelia\Tests\Controller
* @author Benjamin Perche <bperche@openstudio.fr>
*/
class ImportControllerTest extends ImportExportControllerTest
{
/**
* @return \Thelia\Controller\BaseController The controller you want to test
*/
protected function getController()
{
return new ImportController();
}
}

View File

@@ -12,7 +12,6 @@
namespace Thelia\Tests\Controller; namespace Thelia\Tests\Controller;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Thelia\Controller\Admin\ImportController;
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarArchiveBuilder; use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarArchiveBuilder;
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarBz2ArchiveBuilder; use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarBz2ArchiveBuilder;
use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarGzArchiveBuilder; use Thelia\Core\FileFormat\Archive\ArchiveBuilder\TarGzArchiveBuilder;
@@ -28,13 +27,13 @@ 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 ControllerExportControllerTest extends ControllerTestBase abstract class ImportExportControllerTest extends ControllerTestBase
{ {
/** /**
* @return mixed * @return mixed
*/ */
function buildContainer(ContainerBuilder $container) protected function buildContainer(ContainerBuilder $container)
{ {
$archiveBuilderManager = (new ArchiveBuilderManager("dev")) $archiveBuilderManager = (new ArchiveBuilderManager("dev"))
->add(new ZipArchiveBuilder()) ->add(new ZipArchiveBuilder())