This commit is contained in:
DESKTOP-E17406D\boonkerz 2022-10-26 16:55:39 +02:00
parent 68dc808413
commit 8c28091e6f
4 changed files with 3 additions and 3 deletions

View File

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

View File

@ -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 */

0
tests/TestFiles/General/simple.xml Executable file → Normal file
View File

0
tests/TestFiles/General/simple2articles.xml Executable file → Normal file
View File