From 8c28091e6fd164ad14a744dba67929e278226629 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E17406D\\boonkerz" Date: Wed, 26 Oct 2022 16:55:39 +0200 Subject: [PATCH] Fix Calc --- src/Calc/Valid.php | 4 ++-- tests/Recursiv/FirstTest.php | 2 +- tests/TestFiles/General/simple.xml | 0 tests/TestFiles/General/simple2articles.xml | 0 4 files changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 tests/TestFiles/General/simple.xml mode change 100755 => 100644 tests/TestFiles/General/simple2articles.xml 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