Fix Calc
This commit is contained in:
parent
68dc808413
commit
8c28091e6f
@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
0
tests/TestFiles/General/simple.xml
Executable file → Normal file
0
tests/TestFiles/General/simple2articles.xml
Executable file → Normal file
0
tests/TestFiles/General/simple2articles.xml
Executable file → Normal file
Loading…
Reference in New Issue
Block a user