Adding/Refactoring unit test for MatchForEveryoneManager|MatchForTotalAmountManager|MatchForXArticlesManager
This commit is contained in:
@@ -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],
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user