Adding/Refactoring unit test for ConditionFactory/ConditionManagerAbstract

This commit is contained in:
gmorel
2013-11-16 23:58:49 +01:00
parent 3a4bff634e
commit 5679f54ec0
6 changed files with 152 additions and 21 deletions

View File

@@ -54,7 +54,7 @@ abstract class ConditionManagerAbstract implements ConditionManagerInterface
protected $validators = array();
/** @var FacadeInterface Provide necessary value from Thelia */
protected $adapter = null;
protected $facade = null;
/** @var Translator Service Translator */
protected $translator = null;
@@ -71,13 +71,13 @@ abstract class ConditionManagerAbstract implements ConditionManagerInterface
/**
* Constructor
*
* @param FacadeInterface $adapter Service adapter
* @param FacadeInterface $facade Service Facade
*/
public function __construct(FacadeInterface $adapter)
public function __construct(FacadeInterface $facade)
{
$this->adapter = $adapter;
$this->translator = $adapter->getTranslator();
$this->conditionValidator = $adapter->getConditionEvaluator();
$this->facade = $facade;
$this->translator = $facade->getTranslator();
$this->conditionValidator = $facade->getConditionEvaluator();
}
/**
@@ -181,9 +181,9 @@ abstract class ConditionManagerAbstract implements ConditionManagerInterface
* @return bool
* @throws \Thelia\Exception\InvalidConditionValueException
*/
protected function IsCurrencyValid($currencyValue)
protected function isCurrencyValid($currencyValue)
{
$availableCurrencies = $this->adapter->getAvailableCurrencies();
$availableCurrencies = $this->facade->getAvailableCurrencies();
/** @var Currency $currency */
$currencyFound = false;
foreach ($availableCurrencies as $currency) {