diff --git a/src/Calc/Valid.php b/src/Calc/Valid.php index 9facb93..e485531 100644 --- a/src/Calc/Valid.php +++ b/src/Calc/Valid.php @@ -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; } -} \ No newline at end of file +} diff --git a/tests/Legacy/selectWithGrenzenTest.php b/tests/Legacy/selectWithGrenzenTest.php index 63e9423..6d20532 100644 --- a/tests/Legacy/selectWithGrenzenTest.php +++ b/tests/Legacy/selectWithGrenzenTest.php @@ -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()); } -} \ No newline at end of file +}