module image

This commit is contained in:
Etienne Roudeix
2013-09-18 15:58:58 +02:00
parent 9b37bbb862
commit 45106f24bd
16 changed files with 307 additions and 11 deletions

View File

@@ -25,7 +25,6 @@ namespace Cheque;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Model\Country;
use Thelia\Module\BaseModule;
use Thelia\Module\PaymentModuleInterface;
@@ -73,4 +72,9 @@ class Cheque extends BaseModule implements PaymentModuleInterface
// TODO: Implement destroy() method.
}
public function getCode()
{
return 'Cheque';
}
}

View File

@@ -81,4 +81,9 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
// TODO: Implement destroy() method.
}
public function getCode()
{
return 'Colissimo';
}
}

View File

@@ -41,4 +41,9 @@ class DebugBar extends BaseModule
{
// TODO: Implement destroy() method.
}
public function getCode()
{
return 'DebugBar';
}
}

View File

@@ -21,15 +21,15 @@
/* */
/*************************************************************************************/
namespace Paypal;
namespace FakeCB;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Thelia\Model\Country;
use Thelia\Model\Base\ModuleImageQuery;
use Thelia\Module\BaseModule;
use Thelia\Module\PaymentModuleInterface;
class Paypal extends BaseModule implements PaymentModuleInterface
class FakeCB extends BaseModule implements PaymentModuleInterface
{
protected $request;
protected $dispatcher;
@@ -59,13 +59,13 @@ class Paypal extends BaseModule implements PaymentModuleInterface
// TODO: Implement pay() method.
}
/**
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class
* Like install and destroy
*/
public function install()
{
// TODO: Implement install() method.
/* insert the images from image folder if first module activation */
$module = $this->getModuleModel();
if(ModuleImageQuery::create()->filterByModule($module)->count() == 0) {
$this->deployImageFolder($module, sprintf('%s/images', __DIR__));
}
}
public function destroy()
@@ -73,4 +73,9 @@ class Paypal extends BaseModule implements PaymentModuleInterface
// TODO: Implement destroy() method.
}
public function getCode()
{
return 'FakeCB';
}
}

View File

@@ -0,0 +1,54 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace FakeCB\Tests;
use FakeCB\FakeCB;
use Thelia\Tests\Module\BaseModuleTestor;
/**
*
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*
*/
class FakeCBTest extends BaseModuleTestor
{
public function getTestedClassName()
{
return 'FakeCB\FakeCB';
}
public function getTestedInstance()
{
return new FakeCB();
}
public function testInstall()
{
$fakeCB = new FakeCB();
$fakeCB->install();
$out = true;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB