Adding/Refactoring unit test for MatchForEveryoneManager|MatchForTotalAmountManager|MatchForXArticlesManager

This commit is contained in:
gmorel
2013-11-17 18:10:13 +01:00
parent 219ffdec99
commit ed1670a61b
2 changed files with 21 additions and 4 deletions

View File

@@ -155,10 +155,6 @@ class MatchForTotalAmountManager extends ConditionManagerAbstract
$this->availableOperators[self::INPUT2] $this->availableOperators[self::INPUT2]
); );
if (!$isOperator1Legit || !$isOperator2Legit) {
return false;
}
$condition1 = $this->conditionValidator->variableOpComparison( $condition1 = $this->conditionValidator->variableOpComparison(
$this->facade->getCartTotalPrice(), $this->facade->getCartTotalPrice(),
$this->operators[self::INPUT1], $this->operators[self::INPUT1],

View File

@@ -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);
}
} }