This commit is contained in:
Thomas Peterson 2019-02-06 18:36:36 +01:00
parent a9b3a17518
commit 9a8aec0619
2 changed files with 19 additions and 17 deletions

View File

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

View File

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