From ed1670a61bbc7ec382da23446a6d897f617e0502 Mon Sep 17 00:00:00 2001 From: gmorel Date: Sun, 17 Nov 2013 18:10:13 +0100 Subject: [PATCH] Adding/Refactoring unit test for MatchForEveryoneManager|MatchForTotalAmountManager|MatchForXArticlesManager --- .../MatchForTotalAmountManager.php | 4 ---- .../MatchForEveryoneManagerTest.php | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmountManager.php b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmountManager.php index 874ad508e..38b02abc4 100644 --- a/core/lib/Thelia/Condition/Implementation/MatchForTotalAmountManager.php +++ b/core/lib/Thelia/Condition/Implementation/MatchForTotalAmountManager.php @@ -155,10 +155,6 @@ class MatchForTotalAmountManager extends ConditionManagerAbstract $this->availableOperators[self::INPUT2] ); - if (!$isOperator1Legit || !$isOperator2Legit) { - return false; - } - $condition1 = $this->conditionValidator->variableOpComparison( $this->facade->getCartTotalPrice(), $this->operators[self::INPUT1], diff --git a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneManagerTest.php b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneManagerTest.php index 38da60859..198cf7f3f 100644 --- a/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneManagerTest.php +++ b/core/lib/Thelia/Tests/Condition/Implementation/MatchForEveryoneManagerTest.php @@ -197,4 +197,25 @@ class MatchForEveryoneManagerTest extends \PHPUnit_Framework_TestCase } + /** + * Check validator + * + * @covers Thelia\Condition\Implementation\setValidatorsFromForm::generateInputs + * + */ + public function testSetValidator() + { + $stubFacade = $this->generateFacadeStub(399, 'EUR'); + + /** @var FacadeInterface $stubFacade */ + $condition1 = new MatchForEveryoneManager($stubFacade); + + $actual = $condition1->setValidatorsFromForm(array(), array()); + + $expected = $condition1; + + $this->assertEquals($expected, $actual); + + } + }