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;
|
||||
|
||||
Reference in New Issue
Block a user