Fix Calc
This commit is contained in:
parent
a9b3a17518
commit
9a8aec0619
@ -33,19 +33,6 @@ class Valid
|
||||
/** @var Base $option */
|
||||
foreach($this->article->getOptions() as $option) {
|
||||
|
||||
if(count($option->getEdgesCollectionContainer()) > 0) {
|
||||
$option->setIsValid(false);
|
||||
}
|
||||
/** @var EdgeCollection $collection */
|
||||
foreach($option->getEdgesCollectionContainer() as $collection) {
|
||||
/** @var Edge $edge */
|
||||
foreach($collection as $edge) {
|
||||
if($this->edgeIsValid($collection->getName(), $edge)) {
|
||||
$option->setIsValid(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($option instanceof Select) {
|
||||
|
||||
$valid = false;
|
||||
@ -77,6 +64,21 @@ class Valid
|
||||
$option->setIsValid($valid);
|
||||
|
||||
}
|
||||
|
||||
if(count($option->getEdgesCollectionContainer()) > 0) {
|
||||
$option->setIsValid(false);
|
||||
}
|
||||
/** @var EdgeCollection $collection */
|
||||
foreach($option->getEdgesCollectionContainer() as $collection) {
|
||||
/** @var Edge $edge */
|
||||
foreach($collection as $edge) {
|
||||
if($this->edgeIsValid($collection->getName(), $edge)) {
|
||||
$option->setIsValid(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -111,4 +113,4 @@ class Valid
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,9 +35,9 @@ class selectWithGrenzenTest extends \PHPUnit_Framework_TestCase
|
||||
/** @var Article $article */
|
||||
$article = $this->engine->getArticle();
|
||||
|
||||
$this->assertCount(3, $article->getValidOptions());
|
||||
$this->assertCount(2, $article->getValidOptions());
|
||||
|
||||
$this->assertCount(3, $article->getOptionsAsArray());
|
||||
$this->assertCount(2, $article->getOptionsAsArray());
|
||||
}
|
||||
|
||||
public function testSelectWithGrenzenParams()
|
||||
@ -52,4 +52,4 @@ class selectWithGrenzenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertCount(6, $article->getOptionsAsArray());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user