diff --git a/src/Calc/Valid.php b/src/Calc/Valid.php index 39fb08f..5885611 100644 --- a/src/Calc/Valid.php +++ b/src/Calc/Valid.php @@ -41,10 +41,10 @@ class Valid /** @var Base $option */ foreach($this->article->getOptions() as $option) { if($option instanceof Input) { - if($option->getMaxValue() && $option->getMaxValue() <= $option->getRawValue()) { + if($option->getMaxValue() && $option->getRawValue() > $option->getMaxValue()) { $option->addValidationError(new Max(intval($option->getRawValue()), $option->getMaxValue())); } - if($option->getMinValue() && $option->getMinValue() >= $option->getRawValue()) { + if($option->getMinValue() && $option->getRawValue() < $option->getMinValue()) { $option->addValidationError(new Min(intval($option->getRawValue()), $option->getMinValue())); } } diff --git a/tests/Recursiv/FirstTest.php b/tests/Recursiv/FirstTest.php index c1ff4e0..ff1bc4b 100644 --- a/tests/Recursiv/FirstTest.php +++ b/tests/Recursiv/FirstTest.php @@ -9,7 +9,7 @@ use PSC\Library\Calc\Engine; use PSC\Library\Calc\PaperContainer; use PSC\Library\Calc\Tests\Mock\PaperRepostory; -class SecondTest extends TestCase +class FirstTest extends TestCase { /** @var Engine */ diff --git a/tests/TestFiles/General/simple.xml b/tests/TestFiles/General/simple.xml old mode 100755 new mode 100644 diff --git a/tests/TestFiles/General/simple2articles.xml b/tests/TestFiles/General/simple2articles.xml old mode 100755 new mode 100644