WIP : Refactor contraint/rule becomes conditions (more generic)
This commit is contained in:
@@ -27,8 +27,8 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Thelia\Constraint\Rule\AvailableForTotalAmountManager;
|
||||
use Thelia\Constraint\Rule\AvailableForXArticlesManager;
|
||||
use Thelia\Constraint\Rule\Operators;
|
||||
use Thelia\Coupon\CouponBaseAdapter;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
use Thelia\Coupon\BaseAdapter;
|
||||
use Thelia\Coupon\ConditionCollection;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
@@ -169,7 +169,7 @@ class ConstraintFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
$rule2->setValidatorsFromForm($operators, $values);
|
||||
|
||||
$rules = new CouponRuleCollection();
|
||||
$rules = new ConditionCollection();
|
||||
$rules->add($rule1);
|
||||
$rules->add($rule2);
|
||||
|
||||
@@ -209,10 +209,10 @@ class ConstraintFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$rule1 = new AvailableForTotalAmountManager($stubAdapter);
|
||||
$rule2 = new AvailableForXArticlesManager($stubAdapter);
|
||||
|
||||
$adapter = new CouponBaseAdapter($container);
|
||||
$adapter = new BaseAdapter($container);
|
||||
|
||||
$container->set('thelia.constraint.rule.available_for_total_amount', $rule1);
|
||||
$container->set('thelia.constraint.rule.available_for_x_articles', $rule2);
|
||||
$container->set('thelia.condition.match_for_total_amount', $rule1);
|
||||
$container->set('thelia.condition.match_for_x_articles', $rule2);
|
||||
$container->set('thelia.adapter', $adapter);
|
||||
|
||||
return $container;
|
||||
|
||||
@@ -27,15 +27,15 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Thelia\Constraint\Rule\AvailableForTotalAmountManager;
|
||||
use Thelia\Constraint\Rule\AvailableForXArticlesManager;
|
||||
use Thelia\Constraint\Rule\Operators;
|
||||
use Thelia\Coupon\CouponBaseAdapter;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
use Thelia\Coupon\BaseAdapter;
|
||||
use Thelia\Coupon\ConditionCollection;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Unit Test ConstraintValidator Class
|
||||
* Unit Test ConditionEvaluator Class
|
||||
*
|
||||
* @package Constraint
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
@@ -54,7 +54,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testTestSuccess1Rules()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$stubAdapter = $this->getMockBuilder('\Thelia\Coupon\CouponBaseAdapter')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
@@ -79,7 +79,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
AvailableForTotalAmountManager::INPUT2 => 'EUR');
|
||||
$rule1->setValidatorsFromForm($operators, $values);
|
||||
|
||||
$rules = new CouponRuleCollection();
|
||||
$rules = new ConditionCollection();
|
||||
$rules->add($rule1);
|
||||
|
||||
$isValid = $ConstraintValidator->isMatching($rules);
|
||||
@@ -91,7 +91,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testTestFail1Rules()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$stubAdapter = $this->getMockBuilder('\Thelia\Coupon\CouponBaseAdapter')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
@@ -116,7 +116,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
AvailableForTotalAmountManager::INPUT2 => 'EUR');
|
||||
$rule1->setValidatorsFromForm($operators, $values);
|
||||
|
||||
$rules = new CouponRuleCollection();
|
||||
$rules = new ConditionCollection();
|
||||
$rules->add($rule1);
|
||||
|
||||
$isValid = $ConstraintValidator->isMatching($rules);
|
||||
@@ -128,7 +128,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testTestSuccess2Rules()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$stubAdapter = $this->getMockBuilder('\Thelia\Coupon\CouponBaseAdapter')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
@@ -165,7 +165,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
$rule2->setValidatorsFromForm($operators, $values);
|
||||
|
||||
$rules = new CouponRuleCollection();
|
||||
$rules = new ConditionCollection();
|
||||
$rules->add($rule1);
|
||||
$rules->add($rule2);
|
||||
|
||||
@@ -178,7 +178,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testTestFail2Rules()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$stubAdapter = $this->getMockBuilder('\Thelia\Coupon\CouponBaseAdapter')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
@@ -215,7 +215,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
$rule2->setValidatorsFromForm($operators, $values);
|
||||
|
||||
$rules = new CouponRuleCollection();
|
||||
$rules = new ConditionCollection();
|
||||
$rules->add($rule1);
|
||||
$rules->add($rule2);
|
||||
|
||||
@@ -228,7 +228,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testVariableOpComparisonSuccess()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$expected = true;
|
||||
$actual = $ConstraintValidator->variableOpComparison(1, Operators::EQUAL, 1);
|
||||
$this->assertEquals($expected, $actual);
|
||||
@@ -264,7 +264,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testVariableOpComparisonFail()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$expected = false;
|
||||
$actual = $ConstraintValidator->variableOpComparison(2, Operators::EQUAL, 1);
|
||||
$this->assertEquals($expected, $actual);
|
||||
@@ -297,7 +297,7 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testVariableOpComparisonException()
|
||||
{
|
||||
$ConstraintValidator = new ConstraintValidator();
|
||||
$ConstraintValidator = new ConditionValidator();
|
||||
$expected = true;
|
||||
$actual = $ConstraintValidator->variableOpComparison(1, 'bad', 1);
|
||||
$this->assertEquals($expected, $actual);
|
||||
@@ -327,10 +327,10 @@ class ConstraintValidatorTest extends \PHPUnit_Framework_TestCase
|
||||
$rule1 = new AvailableForTotalAmountManager($stubAdapter);
|
||||
$rule2 = new AvailableForXArticlesManager($stubAdapter);
|
||||
|
||||
$adapter = new CouponBaseAdapter($container);
|
||||
$adapter = new BaseAdapter($container);
|
||||
|
||||
$container->set('thelia.constraint.rule.available_for_total_amount', $rule1);
|
||||
$container->set('thelia.constraint.rule.available_for_x_articles', $rule2);
|
||||
$container->set('thelia.condition.match_for_total_amount', $rule1);
|
||||
$container->set('thelia.condition.match_for_x_articles', $rule2);
|
||||
$container->set('thelia.adapter', $adapter);
|
||||
|
||||
return $container;
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
use Thelia\Constraint\ConstraintValidator;
|
||||
use Thelia\Constraint\ConditionValidator;
|
||||
use Thelia\Constraint\Rule\AvailableForTotalAmountManager;
|
||||
use Thelia\Constraint\Rule\Operators;
|
||||
use Thelia\Exception\InvalidRuleValueException;
|
||||
use Thelia\Exception\InvalidConditionValueException;
|
||||
use Thelia\Model\Currency;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ use Thelia\Model\Currency;
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Unit Test AvailableForTotalAmountManager Class
|
||||
* Unit Test MatchForTotalAmountManager Class
|
||||
*
|
||||
* @package Constraint
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
@@ -42,7 +42,7 @@ use Thelia\Model\Currency;
|
||||
*/
|
||||
class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var CouponAdapterInterface $stubTheliaAdapter */
|
||||
/** @var AdapterInterface $stubTheliaAdapter */
|
||||
protected $stubTheliaAdapter = null;
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$currency1 = new Currency();
|
||||
$currency1->setCode('EUR');
|
||||
@@ -95,7 +95,7 @@ class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForTotalAmountManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleOperatorException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionOperatorException
|
||||
*
|
||||
*/
|
||||
public function testInValidBackOfficeInputOperator()
|
||||
@@ -123,7 +123,7 @@ class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForTotalAmountManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleOperatorException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionOperatorException
|
||||
*
|
||||
*/
|
||||
public function testInValidBackOfficeInputOperator2()
|
||||
@@ -151,7 +151,7 @@ class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForTotalAmountManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleValueException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionValueException
|
||||
*
|
||||
*/
|
||||
public function testInValidBackOfficeInputValue()
|
||||
@@ -179,7 +179,7 @@ class AvailableForTotalAmountManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForTotalAmountManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleValueException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionValueException
|
||||
*
|
||||
*/
|
||||
public function testInValidBackOfficeInputValue2()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
namespace Thelia\Coupon;
|
||||
|
||||
use Thelia\Constraint\ConstraintValidator;
|
||||
use Thelia\Constraint\ConditionValidator;
|
||||
use Thelia\Constraint\Rule\AvailableForXArticlesManager;
|
||||
use Thelia\Constraint\Rule\Operators;
|
||||
use Thelia\Constraint\Rule\SerializableRule;
|
||||
@@ -33,7 +33,7 @@ use Thelia\Constraint\Rule\SerializableRule;
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Unit Test AvailableForXArticlesManager Class
|
||||
* Unit Test MatchForXArticlesManager Class
|
||||
*
|
||||
* @package Constraint
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
@@ -42,7 +42,7 @@ use Thelia\Constraint\Rule\SerializableRule;
|
||||
class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
// /** @var CouponAdapterInterface $stubTheliaAdapter */
|
||||
// /** @var AdapterInterface $stubTheliaAdapter */
|
||||
// protected $stubTheliaAdapter = null;
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForXArticlesManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleOperatorException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionOperatorException
|
||||
*/
|
||||
public function testInValidBackOfficeInputOperator()
|
||||
{
|
||||
@@ -71,7 +71,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -93,7 +93,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
* Check if validity test on BackOffice inputs are working
|
||||
*
|
||||
* @covers Thelia\Coupon\Rule\AvailableForXArticlesManager::setValidators
|
||||
* @expectedException \Thelia\Exception\InvalidRuleValueException
|
||||
* @expectedException \Thelia\Exception\InvalidConditionValueException
|
||||
*/
|
||||
public function testInValidBackOfficeInputValue()
|
||||
{
|
||||
@@ -106,7 +106,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -141,7 +141,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -176,7 +176,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -211,7 +211,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -246,7 +246,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -281,7 +281,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -316,7 +316,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -351,7 +351,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -386,7 +386,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -421,7 +421,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -456,7 +456,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -491,7 +491,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -526,7 +526,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -555,7 +555,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -590,7 +590,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
->will($this->returnValue(4));
|
||||
$stubAdapter->expects($this->any())
|
||||
->method('getConstraintValidator')
|
||||
->will($this->returnValue(new ConstraintValidator()));
|
||||
->will($this->returnValue(new ConditionValidator()));
|
||||
|
||||
$rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
$operators = array(
|
||||
@@ -618,7 +618,7 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
// public function testGetValidators()
|
||||
// {
|
||||
// $stubAdapter = $this->getMockBuilder('\Thelia\Coupon\CouponBaseAdapter')
|
||||
// $stubAdapter = $this->getMockBuilder('\Thelia\Coupon\BaseAdapter')
|
||||
// ->disableOriginalConstructor()
|
||||
// ->getMock();
|
||||
//
|
||||
@@ -626,12 +626,12 @@ class AvailableForXArticlesManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// ->method('getNbArticlesInCart')
|
||||
// ->will($this->returnValue(4));
|
||||
//
|
||||
// $rule1 = new AvailableForXArticlesManager($stubAdapter);
|
||||
// $rule1 = new MatchForXArticlesManager($stubAdapter);
|
||||
// $operators = array(
|
||||
// AvailableForXArticlesManager::INPUT1 => Operators::SUPERIOR
|
||||
// MatchForXArticlesManager::INPUT1 => Operators::SUPERIOR
|
||||
// );
|
||||
// $values = array(
|
||||
// AvailableForXArticlesManager::INPUT1 => 4
|
||||
// MatchForXArticlesManager::INPUT1 => 4
|
||||
// );
|
||||
// $rule1->setValidatorsFromForm($operators, $values);
|
||||
//
|
||||
|
||||
@@ -110,7 +110,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testOperatorInferiorValidBefore()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// // Given
|
||||
// $a = 11;
|
||||
// $operator = Operators::INFERIOR;
|
||||
@@ -131,7 +131,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInferiorInvalidEquals()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::INFERIOR;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -151,7 +151,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInferiorInvalidAfter()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 13;
|
||||
// $operator = Operators::INFERIOR;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -171,7 +171,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInferiorOrEqualValidEqual()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 11;
|
||||
// $operator = Operators::INFERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
@@ -191,7 +191,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInferiorOrEqualValidBefore()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 10;
|
||||
// $operator = Operators::INFERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
@@ -211,7 +211,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInferiorOrEqualInValidAfter()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::INFERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
@@ -231,7 +231,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorEqualValidEqual()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::EQUAL;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -251,7 +251,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorEqualInValidBefore()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 11;
|
||||
// $operator = Operators::EQUAL;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -271,7 +271,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorEqualInValidAfter()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 13;
|
||||
// $operator = Operators::EQUAL;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -291,7 +291,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorOrEqualValidEqual()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 13;
|
||||
// $operator = Operators::SUPERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 13);
|
||||
@@ -311,7 +311,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorOrEqualAfter()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 14;
|
||||
// $operator = Operators::SUPERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 13);
|
||||
@@ -331,7 +331,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorOrEqualInvalidBefore()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::SUPERIOR_OR_EQUAL;
|
||||
// $b = new QuantityParam($adapter, 13);
|
||||
@@ -351,7 +351,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorValidAfter()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 13;
|
||||
// $operator = Operators::SUPERIOR;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -371,7 +371,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorInvalidEqual()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::SUPERIOR;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -391,7 +391,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorSuperiorInvalidBefore()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 11;
|
||||
// $operator = Operators::SUPERIOR;
|
||||
// $b = new QuantityParam($adapter, 12);
|
||||
@@ -411,7 +411,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorDifferentValid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = Operators::DIFFERENT;
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
@@ -431,7 +431,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorDifferentInvalidEquals()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 11;
|
||||
// $operator = Operators::DIFFERENT;
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
@@ -451,7 +451,7 @@ class OperatorsTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testOperatorInValid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $a = 12;
|
||||
// $operator = 'X';
|
||||
// $b = new QuantityParam($adapter, 11);
|
||||
|
||||
@@ -50,7 +50,7 @@ class CustomerParamTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
// /** @var CouponAdapterInterface $stubTheliaAdapter */
|
||||
// /** @var AdapterInterface $stubTheliaAdapter */
|
||||
// protected $stubTheliaAdapter = null;
|
||||
//
|
||||
// /**
|
||||
@@ -59,16 +59,16 @@ class CustomerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// protected function setUp()
|
||||
// {
|
||||
// /** @var CouponAdapterInterface $stubTheliaAdapter */
|
||||
// /** @var AdapterInterface $stubTheliaAdapter */
|
||||
// $this->stubTheliaAdapter = $this->generateValidCouponBaseAdapterMock();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Generate valid CouponBaseAdapter
|
||||
// * Generate valid BaseAdapter
|
||||
// *
|
||||
// * @param int $customerId Customer id
|
||||
// *
|
||||
// * @return CouponAdapterInterface
|
||||
// * @return AdapterInterface
|
||||
// */
|
||||
// protected function generateValidCouponBaseAdapterMock($customerId = 4521)
|
||||
// {
|
||||
@@ -78,9 +78,9 @@ class CustomerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// $customer->setLastname('Lastname');
|
||||
// $customer->setEmail('em@il.com');
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubTheliaAdapter */
|
||||
// /** @var AdapterInterface $stubTheliaAdapter */
|
||||
// $stubTheliaAdapter = $this->getMock(
|
||||
// 'Thelia\Coupon\CouponBaseAdapter',
|
||||
// 'Thelia\Coupon\BaseAdapter',
|
||||
// array('getCustomer'),
|
||||
// array()
|
||||
// );
|
||||
@@ -140,7 +140,7 @@ class CustomerParamTest extends \PHPUnit_Framework_TestCase
|
||||
//// */
|
||||
//// public function isSerializableTest()
|
||||
//// {
|
||||
//// $adapter = new CouponBaseAdapter();
|
||||
//// $adapter = new BaseAdapter();
|
||||
//// $intValidator = 42;
|
||||
//// $intToValidate = -1;
|
||||
////
|
||||
|
||||
@@ -62,7 +62,7 @@ class DateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-07");
|
||||
//
|
||||
@@ -80,7 +80,7 @@ class DateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-08");
|
||||
//
|
||||
@@ -98,7 +98,7 @@ class DateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-09");
|
||||
//
|
||||
@@ -115,7 +115,7 @@ class DateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = 1377012588;
|
||||
//
|
||||
@@ -130,7 +130,7 @@ class DateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidator = new \DateTime("2012-07-08");
|
||||
//
|
||||
// $param = new DateParam($adapter, $dateValidator);
|
||||
|
||||
@@ -62,7 +62,7 @@ class IntegerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorInteger()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 41;
|
||||
//
|
||||
@@ -80,7 +80,7 @@ class IntegerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsInteger()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 42;
|
||||
//
|
||||
@@ -98,7 +98,7 @@ class IntegerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorInteger()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 43;
|
||||
//
|
||||
@@ -115,7 +115,7 @@ class IntegerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = '42';
|
||||
//
|
||||
@@ -132,7 +132,7 @@ class IntegerParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
//
|
||||
// $param = new IntegerParam($adapter, $intValidator);
|
||||
|
||||
@@ -62,7 +62,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
// $dateToValidate = new \DateTime("2012-07-07");
|
||||
@@ -81,7 +81,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
// $dateToValidate = new \DateTime("2012-07-08");
|
||||
@@ -103,7 +103,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDate2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
// $dateToValidate = new \DateTime("2012-08-08");
|
||||
@@ -122,7 +122,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
// $dateToValidate = new \DateTime("2012-08-09");
|
||||
@@ -140,7 +140,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
// $dateToValidate = 1377012588;
|
||||
@@ -156,7 +156,7 @@ class IntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $dateValidatorStart = new \DateTime("2012-07-08");
|
||||
// $dateValidatorInterval = new \DateInterval("P1M"); //1month
|
||||
//
|
||||
|
||||
@@ -62,7 +62,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorPrice()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 1.00;
|
||||
@@ -81,7 +81,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorPrice2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 42.49;
|
||||
@@ -100,7 +100,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsPrice()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 42.50;
|
||||
@@ -119,7 +119,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorPrice()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 42.51;
|
||||
@@ -137,7 +137,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = '42.50';
|
||||
@@ -155,7 +155,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = -1;
|
||||
@@ -173,7 +173,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException3()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
//
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 0;
|
||||
@@ -191,7 +191,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException4()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $priceValidator = 42.50;
|
||||
// $priceToValidate = 1;
|
||||
//
|
||||
@@ -208,7 +208,7 @@ class PriceParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $priceValidator = 42.50;
|
||||
//
|
||||
// $param = new PriceParam($adapter, $priceValidator, 'GBP');
|
||||
|
||||
@@ -62,7 +62,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorQuantity()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 0;
|
||||
//
|
||||
@@ -80,7 +80,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorQuantity2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 41;
|
||||
//
|
||||
@@ -98,7 +98,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsQuantity()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 42;
|
||||
//
|
||||
@@ -116,7 +116,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorQuantity()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = 43;
|
||||
//
|
||||
@@ -133,7 +133,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = '42';
|
||||
//
|
||||
@@ -150,7 +150,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = -1;
|
||||
//
|
||||
@@ -167,7 +167,7 @@ class QuantityParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $intValidator = 42;
|
||||
// $intToValidate = -1;
|
||||
//
|
||||
|
||||
@@ -62,7 +62,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-07");
|
||||
//
|
||||
@@ -82,7 +82,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeFirstPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-08");
|
||||
//
|
||||
@@ -102,7 +102,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeSecondPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-08");
|
||||
//
|
||||
@@ -122,7 +122,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthTenTimesThirdPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-09-08");
|
||||
//
|
||||
@@ -142,7 +142,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthTenTimesTensPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2013-05-08");
|
||||
//
|
||||
@@ -162,7 +162,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryFourMonthTwoTimesSecondPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-11-08");
|
||||
//
|
||||
@@ -182,7 +182,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryFourMonthTwoTimesLastPeriod()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2013-03-08");
|
||||
//
|
||||
@@ -202,7 +202,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testNotEqualsDateRepeatEveryFourMonthTwoTimes1()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-08");
|
||||
//
|
||||
@@ -222,7 +222,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testNotEqualsDateRepeatEveryFourMonthTwoTimes2()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-12-08");
|
||||
//
|
||||
@@ -242,7 +242,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorDateRepeatEveryFourMonthTwoTimes()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2013-03-09");
|
||||
//
|
||||
@@ -261,7 +261,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = 1377012588;
|
||||
//
|
||||
@@ -278,7 +278,7 @@ class RepeatedDateParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
//
|
||||
// $param = new RepeatedDateParam($adapter);
|
||||
|
||||
@@ -61,7 +61,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInferiorDate()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-07");
|
||||
// $duration = 10;
|
||||
@@ -84,7 +84,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeFirstPeriodBeginning()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-08");
|
||||
// $duration = 10;
|
||||
@@ -106,7 +106,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeFirstPeriodMiddle()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-13");
|
||||
// $duration = 10;
|
||||
@@ -128,7 +128,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeFirstPeriodEnding()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-18");
|
||||
// $duration = 10;
|
||||
@@ -150,7 +150,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeSecondPeriodBeginning()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-08-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-08");
|
||||
// $duration = 10;
|
||||
@@ -172,7 +172,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeSecondPeriodMiddle()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-08-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-13");
|
||||
// $duration = 10;
|
||||
@@ -194,7 +194,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthOneTimeSecondPeriodEnding()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-08-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-18");
|
||||
// $duration = 10;
|
||||
@@ -216,7 +216,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthFourTimeLastPeriodBeginning()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-10-08");
|
||||
// $duration = 10;
|
||||
@@ -238,7 +238,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthFourTimeLastPeriodMiddle()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-10-13");
|
||||
// $duration = 10;
|
||||
@@ -260,7 +260,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testEqualsDateRepeatEveryMonthFourTimeLastPeriodEnding()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-10-18");
|
||||
// $duration = 10;
|
||||
@@ -282,7 +282,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testNotEqualsDateRepeatEveryMonthFourTimeInTheBeginning()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-07-19");
|
||||
// $duration = 10;
|
||||
@@ -304,7 +304,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testNotEqualsDateRepeatEveryMonthFourTimeInTheMiddle()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-01");
|
||||
// $duration = 10;
|
||||
@@ -327,7 +327,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testNotEqualsDateRepeatEveryMonthFourTimeInTheEnd()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-10-08");
|
||||
// $dateToValidate = new \DateTime("2012-08-07");
|
||||
// $duration = 10;
|
||||
@@ -351,7 +351,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testSuperiorDateRepeatEveryMonthFourTime()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = new \DateTime("2012-10-19");
|
||||
// $duration = 10;
|
||||
@@ -372,7 +372,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testInvalidArgumentException()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = 1377012588;
|
||||
// $duration = 10;
|
||||
@@ -391,7 +391,7 @@ class RepeatedIntervalParamTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function isSerializableTest()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $startDateValidator = new \DateTime("2012-07-08");
|
||||
// $dateToValidate = 1377012588;
|
||||
// $duration = 10;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Thelia\Coupon;
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Unit Test CouponBaseAdapter Class
|
||||
* Unit Test BaseAdapter Class
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
@@ -44,7 +44,7 @@ class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
// /**
|
||||
// * @var CouponBaseAdapter
|
||||
// * @var BaseAdapter
|
||||
// */
|
||||
// protected $object;
|
||||
//
|
||||
@@ -54,7 +54,7 @@ class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// protected function setUp()
|
||||
// {
|
||||
// $this->object = new CouponBaseAdapter;
|
||||
// $this->object = new BaseAdapter;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
@@ -66,7 +66,7 @@ class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @covers Thelia\Coupon\CouponBaseAdapter::getCart
|
||||
// * @covers Thelia\Coupon\BaseAdapter::getCart
|
||||
// * @todo Implement testGetCart().
|
||||
// */
|
||||
// public function testGetCart()
|
||||
@@ -78,7 +78,7 @@ class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @covers Thelia\Coupon\CouponBaseAdapter::getDeliveryAddress
|
||||
// * @covers Thelia\Coupon\BaseAdapter::getDeliveryAddress
|
||||
// * @todo Implement testGetDeliveryAddress().
|
||||
// */
|
||||
// public function testGetDeliveryAddress()
|
||||
@@ -90,7 +90,7 @@ class CouponBaseAdapterTest extends \PHPUnit_Framework_TestCase
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * @covers Thelia\Coupon\CouponBaseAdapter::getCustomer
|
||||
// * @covers Thelia\Coupon\BaseAdapter::getCustomer
|
||||
// * @todo Implement testGetCustomer().
|
||||
// */
|
||||
// public function testGetCustomer()
|
||||
|
||||
@@ -74,7 +74,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// * @param bool $isUsed If Coupon has been used yet
|
||||
// * @param bool $isEnabled If Coupon is enabled
|
||||
// * @param \DateTime $expirationDate When Coupon expires
|
||||
// * @param CouponRuleCollection $rules Coupon rules
|
||||
// * @param ConditionCollection $rules Coupon rules
|
||||
// * @param bool $isCumulative If Coupon is cumulative
|
||||
// * @param bool $isRemovingPostage If Coupon is removing postage
|
||||
// *
|
||||
@@ -109,9 +109,9 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// $isRemovingPostage
|
||||
// );
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->getMock(
|
||||
// 'Thelia\Coupon\CouponBaseAdapter',
|
||||
// 'Thelia\Coupon\BaseAdapter',
|
||||
// array('findOneCouponByCode'),
|
||||
// array()
|
||||
// );
|
||||
@@ -135,7 +135,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// $date = new \DateTime();
|
||||
// $date->setTimestamp(strtotime("today - 2 months"));
|
||||
//
|
||||
// /** @var CouponAdapterInterface $mockAdapter */
|
||||
// /** @var AdapterInterface $mockAdapter */
|
||||
// $mockAdapter = $this->generateCouponModelMock(null, null, null, null, null, null, null, null, $date);
|
||||
// $couponFactory = new CouponFactory($mockAdapter);
|
||||
// $coupon = $couponFactory->buildCouponFromCode('XMAS1');
|
||||
@@ -151,7 +151,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// {
|
||||
// $date = new \DateTime();
|
||||
//
|
||||
// /** @var CouponAdapterInterface $mockAdapter */
|
||||
// /** @var AdapterInterface $mockAdapter */
|
||||
// $mockAdapter = $this->generateCouponModelMock(null, null, null, null, null, null, null, null, $date);
|
||||
// $couponFactory = new CouponFactory($mockAdapter);
|
||||
// $coupon = $couponFactory->buildCouponFromCode('XMAS1');
|
||||
@@ -165,8 +165,8 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testBuildCouponFromCodeWithoutRule()
|
||||
// {
|
||||
// /** @var CouponAdapterInterface $mockAdapter */
|
||||
// $mockAdapter = $this->generateCouponModelMock(null, null, null, null, null, null, null, null, null, new CouponRuleCollection(array()));
|
||||
// /** @var AdapterInterface $mockAdapter */
|
||||
// $mockAdapter = $this->generateCouponModelMock(null, null, null, null, null, null, null, null, null, new ConditionCollection(array()));
|
||||
// $couponFactory = new CouponFactory($mockAdapter);
|
||||
// $coupon = $couponFactory->buildCouponFromCode('XMAS1');
|
||||
// }
|
||||
@@ -178,7 +178,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testBuildCouponFromCode()
|
||||
// {
|
||||
// /** @var CouponAdapterInterface $mockAdapter */
|
||||
// /** @var AdapterInterface $mockAdapter */
|
||||
// $mockAdapter = $this->generateCouponModelMock();
|
||||
// $couponFactory = new CouponFactory($mockAdapter);
|
||||
// /** @var CouponInterface $coupon */
|
||||
@@ -206,7 +206,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// /**
|
||||
// * Generate valid CouponRuleInterfaces
|
||||
// *
|
||||
// * @return CouponRuleCollection Set of CouponRuleInterface
|
||||
// * @return ConditionCollection Set of ConditionManagerInterface
|
||||
// */
|
||||
// protected function generateValidRules()
|
||||
// {
|
||||
@@ -230,7 +230,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
//// )
|
||||
//// )
|
||||
//// );
|
||||
//// $rules = new CouponRuleCollection(array($rule1, $rule2));
|
||||
//// $rules = new ConditionCollection(array($rule1, $rule2));
|
||||
////
|
||||
//// return $rules;
|
||||
// }
|
||||
@@ -247,7 +247,7 @@ class CouponFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
// * @param bool $isUsed If Coupon has been used yet
|
||||
// * @param bool $isEnabled If Coupon is enabled
|
||||
// * @param \DateTime $expirationDate When Coupon expires
|
||||
// * @param CouponRuleCollection $rules Coupon rules
|
||||
// * @param ConditionCollection $rules Coupon rules
|
||||
// * @param bool $isCumulative If Coupon is cumulative
|
||||
// * @param bool $isRemovingPostage If Coupon is removing postage
|
||||
// *
|
||||
|
||||
@@ -88,7 +88,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// /** @var CouponInterface $coupon */
|
||||
// $coupon = self::generateValidCoupon();
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter(array($coupon), $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// $couponManager = new CouponManager($stubCouponBaseAdapter);
|
||||
@@ -108,7 +108,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testGetDiscountTwoCoupon()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $cartTotalPrice = 100.00;
|
||||
// $checkoutTotalPrice = 120.00;
|
||||
//
|
||||
@@ -124,11 +124,11 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// $rules = new CouponRuleCollection(array($rule1));
|
||||
// $rules = new ConditionCollection(array($rule1));
|
||||
// /** @var CouponInterface $coupon2 */
|
||||
// $coupon2 = $this->generateValidCoupon('XMAS2', null, null, null, 15.00, null, null, $rules);
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter(array($coupon1, $coupon2), $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// $couponManager = new CouponManager($stubCouponBaseAdapter);
|
||||
@@ -148,7 +148,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testGetDiscountAlwaysInferiorToPrice()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $cartTotalPrice = 21.00;
|
||||
// $checkoutTotalPrice = 26.00;
|
||||
//
|
||||
@@ -162,11 +162,11 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// $rules = new CouponRuleCollection(array($rule1));
|
||||
// $rules = new ConditionCollection(array($rule1));
|
||||
// /** @var CouponInterface $coupon */
|
||||
// $coupon = $this->generateValidCoupon('XMAS2', null, null, null, 30.00, null, null, $rules);
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter(array($coupon), $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// $couponManager = new CouponManager($stubCouponBaseAdapter);
|
||||
@@ -185,7 +185,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testIsCouponRemovingPostage()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $cartTotalPrice = 21.00;
|
||||
// $checkoutTotalPrice = 27.00;
|
||||
//
|
||||
@@ -199,11 +199,11 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// $rules = new CouponRuleCollection(array($rule1));
|
||||
// $rules = new ConditionCollection(array($rule1));
|
||||
// /** @var CouponInterface $coupon */
|
||||
// $coupon = $this->generateValidCoupon('XMAS2', null, null, null, 30.00, null, null, $rules, null, true);
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter(array($coupon), $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// $couponManager = new CouponManager($stubCouponBaseAdapter);
|
||||
@@ -231,7 +231,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
//
|
||||
// $coupons = array($couponCumulative1);
|
||||
//
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -264,7 +264,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative1 = $this->generateValidCoupon(null, null, null, null, null, null, null, null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -299,7 +299,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, null, null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -334,7 +334,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, null, null, false);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -369,7 +369,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, null, null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -404,7 +404,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, null, null, false);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -437,7 +437,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative1 = $this->generateValidCoupon('XMAS1', null, null, null, null, null, new \DateTime(), null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -472,7 +472,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, new \DateTime(), null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -507,7 +507,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, null, null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -542,7 +542,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative2 = $this->generateValidCoupon('XMAS2', null, null, null, null, null, new \DateTime(), null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -581,7 +581,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative4 = $this->generateValidCoupon('XMAS4', null, null, null, null, null, null, null, true);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2, $couponCumulative3, $couponCumulative4);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -620,7 +620,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $couponCumulative4 = $this->generateValidCoupon('XMAS4', null, null, null, null, null, null, null, false);
|
||||
//
|
||||
// $coupons = array($couponCumulative1, $couponCumulative2, $couponCumulative3, $couponCumulative4);
|
||||
// /** @var CouponAdapterInterface $stubCouponBaseAdapter */
|
||||
// /** @var AdapterInterface $stubCouponBaseAdapter */
|
||||
// $stubCouponBaseAdapter = $this->generateFakeAdapter($coupons, $cartTotalPrice, $checkoutTotalPrice);
|
||||
//
|
||||
// // When
|
||||
@@ -641,11 +641,11 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// /**
|
||||
// * Generate valid CouponRuleInterfaces
|
||||
// *
|
||||
// * @return array Array of CouponRuleInterface
|
||||
// * @return array Array of ConditionManagerInterface
|
||||
// */
|
||||
// public static function generateValidRules()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule1 = new AvailableForTotalAmount(
|
||||
// $adapter, array(
|
||||
// AvailableForTotalAmount::PARAM1_PRICE => new RuleValidator(
|
||||
@@ -666,7 +666,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// )
|
||||
// )
|
||||
// );
|
||||
// $rules = new CouponRuleCollection(array($rule1, $rule2));
|
||||
// $rules = new ConditionCollection(array($rule1, $rule2));
|
||||
//
|
||||
// return $rules;
|
||||
// }
|
||||
@@ -692,7 +692,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// public function generateFakeAdapter(array $coupons, $cartTotalPrice, $checkoutTotalPrice, $postagePrice = 6.00)
|
||||
// {
|
||||
// $stubCouponBaseAdapter = $this->getMock(
|
||||
// 'Thelia\Coupon\CouponBaseAdapter',
|
||||
// 'Thelia\Coupon\BaseAdapter',
|
||||
// array(
|
||||
// 'getCurrentCoupons',
|
||||
// 'getCartTotalPrice',
|
||||
@@ -734,7 +734,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// * @param float $amount Coupon discount
|
||||
// * @param bool $isEnabled Is Coupon enabled
|
||||
// * @param \DateTime $expirationDate Coupon expiration date
|
||||
// * @param CouponRuleCollection $rules Coupon rules
|
||||
// * @param ConditionCollection $rules Coupon rules
|
||||
// * @param bool $isCumulative If is cumulative
|
||||
// * @param bool $isRemovingPostage If is removing postage
|
||||
// * @param bool $isAvailableOnSpecialOffers If is available on
|
||||
@@ -758,7 +758,7 @@ class CouponManagerTest extends \PHPUnit_Framework_TestCase
|
||||
// $isAvailableOnSpecialOffers = null,
|
||||
// $maxUsage = null
|
||||
// ) {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// if ($code === null) {
|
||||
// $code = self::VALID_CODE;
|
||||
// }
|
||||
|
||||
@@ -33,7 +33,7 @@ use Thelia\Constraint\Rule\Operators;
|
||||
* Date: 8/19/13
|
||||
* Time: 3:24 PM
|
||||
*
|
||||
* Unit Test CouponRuleCollection Class
|
||||
* Unit Test ConditionCollection Class
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
@@ -73,7 +73,7 @@ class CouponRuleCollectionTest extends \PHPUnit_Framework_TestCase
|
||||
//// )
|
||||
//// )
|
||||
//// );
|
||||
//// $rules = new CouponRuleCollection(array($rule1, $rule2));
|
||||
//// $rules = new ConditionCollection(array($rule1, $rule2));
|
||||
////
|
||||
//// $serializedRules = base64_encode(serialize($rules));
|
||||
//// $unserializedRules = unserialize(base64_decode($serializedRules));
|
||||
|
||||
@@ -153,7 +153,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// public function testGetEffect()
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// $expected = 10;
|
||||
@@ -186,7 +186,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0, $rule1, $rule2)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0, $rule1, $rule2)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 3;
|
||||
@@ -216,7 +216,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0, $rule1, $rule2)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0, $rule1, $rule2)));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
@@ -228,7 +228,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testGetEffectIfTotalAmountInferiorTo400Valid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule0 = $this->generateValidRuleAvailableForTotalAmountOperatorTo(
|
||||
// Operators::INFERIOR,
|
||||
// 400.00
|
||||
@@ -236,7 +236,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 10.00;
|
||||
@@ -253,7 +253,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testGetEffectIfTotalAmountInferiorOrEqualTo400Valid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule0 = $this->generateValidRuleAvailableForTotalAmountOperatorTo(
|
||||
// Operators::INFERIOR_OR_EQUAL,
|
||||
// 400.00
|
||||
@@ -261,7 +261,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 10.00;
|
||||
@@ -278,7 +278,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testGetEffectIfTotalAmountEqualTo400Valid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule0 = $this->generateValidRuleAvailableForTotalAmountOperatorTo(
|
||||
// Operators::EQUAL,
|
||||
// 400.00
|
||||
@@ -286,7 +286,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 10.00;
|
||||
@@ -303,7 +303,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testGetEffectIfTotalAmountSuperiorOrEqualTo400Valid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule0 = $this->generateValidRuleAvailableForTotalAmountOperatorTo(
|
||||
// Operators::SUPERIOR_OR_EQUAL,
|
||||
// 400.00
|
||||
@@ -311,7 +311,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 10.00;
|
||||
@@ -328,7 +328,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// public function testGetEffectIfTotalAmountSuperiorTo400Valid()
|
||||
// {
|
||||
// // Given
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $rule0 = $this->generateValidRuleAvailableForTotalAmountOperatorTo(
|
||||
// Operators::SUPERIOR,
|
||||
// 400.00
|
||||
@@ -336,7 +336,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = CouponManagerTest::generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 10.00;
|
||||
@@ -365,7 +365,7 @@ class RemoveXAmountTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// protected function generateValidRuleAvailableForTotalAmountOperatorTo($operator, $amount)
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $validators = array(
|
||||
// AvailableForTotalAmount::PARAM1_PRICE => new RuleValidator(
|
||||
// $operator,
|
||||
|
||||
@@ -158,7 +158,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0, $rule1, $rule2)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0, $rule1, $rule2)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 3;
|
||||
@@ -188,7 +188,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0, $rule1, $rule2)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0, $rule1, $rule2)));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
@@ -207,7 +207,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 24.50;
|
||||
@@ -231,7 +231,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 24.50;
|
||||
@@ -255,7 +255,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 24.50;
|
||||
@@ -279,7 +279,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 24.50;
|
||||
@@ -303,7 +303,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// $coupon = $this->generateValidCoupon(null, null, null, null, null, null, null, null, false, false);
|
||||
//
|
||||
// // When
|
||||
// $coupon->setRules(new CouponRuleCollection(array($rule0)));
|
||||
// $coupon->setRules(new ConditionCollection(array($rule0)));
|
||||
//
|
||||
// // Then
|
||||
// $expected = 24.50;
|
||||
@@ -322,7 +322,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// * @param float $amount Coupon discount
|
||||
// * @param bool $isEnabled Is Coupon enabled
|
||||
// * @param \DateTime $expirationDate Coupon expiration date
|
||||
// * @param CouponRuleCollection $rules Coupon rules
|
||||
// * @param ConditionCollection $rules Coupon rules
|
||||
// * @param bool $isCumulative If is cumulative
|
||||
// * @param bool $isRemovingPostage If is removing postage
|
||||
// * @param bool $isAvailableOnSpecialOffers If is available on
|
||||
@@ -407,7 +407,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// */
|
||||
// protected function generateValidRuleAvailableForTotalAmountOperatorTo($operator, $amount)
|
||||
// {
|
||||
// $adapter = new CouponBaseAdapter();
|
||||
// $adapter = new BaseAdapter();
|
||||
// $validators = array(
|
||||
// AvailableForTotalAmount::PARAM1_PRICE => new RuleValidator(
|
||||
// $operator,
|
||||
@@ -432,7 +432,7 @@ class RemoveXPercentTest extends \PHPUnit_Framework_TestCase
|
||||
// public function generateFakeAdapter($cartTotalPrice)
|
||||
// {
|
||||
// $stubCouponBaseAdapter = $this->getMock(
|
||||
// 'Thelia\Coupon\CouponBaseAdapter',
|
||||
// 'Thelia\Coupon\BaseAdapter',
|
||||
// array(
|
||||
// 'getCartTotalPrice'
|
||||
// ),
|
||||
|
||||
Reference in New Issue
Block a user