public function testToArray()
 {
     $array = array('Conjunction' => true, 'Disjunction' => false, 'Any' => false, 'Negation' => true);
     $NC = new NestingConstraint();
     $NC->addConnective('Conjunction', true);
     $NC->addConnective('Disjunction', false);
     $NC->addConnective('Any', false);
     $NC->addConnective('Negation', true);
     $this->assertEquals($array, $NC->toArray());
 }
 protected function parseNestingConstraints($maxLevels)
 {
     $array['constraints']['antecedent'] = array();
     $array['constraints']['consequent'] = array();
     $array['constraints']['condition'] = array();
     foreach ($this->XPath->evaluate('BuildingBlocks/DerivedBooleanAttribute/NestingConstraints') as $k => $elNcs) {
         $scope = $elNcs->getAttribute('scope');
         $NC = new NestingConstraint();
         foreach ($this->XPath->evaluate('NestingConstraint', $elNcs) as $k => $elNc) {
             $level = $elNc->getAttribute('level');
             foreach ($this->XPath->evaluate('Connectives/child::node()', $elNc) as $c) {
                 $allowed = $c->getAttribute('allowed') === 'yes';
                 if (!$NC->hasConnective($c->nodeName)) {
                     $NC->addConnective($c->nodeName, $allowed);
                 } else {
                     if (!$NC->isConnectiveAllowed($c->nodeName) && $allowed) {
                         $NC->updateConnective($c->nodeName, $allowed);
                     }
                 }
             }
             /*
             if ($level === self::$CONSTRAINT_REMAINING) {
                 for ($i = ($k + 1); $i <= $maxLevels; $i++) {
                     $NC->setLevel($i);
                     if ($scope === 'all') {
                         $array['constraints']['antecedent'] = array_merge_recursive($array['constraints']['antecedent'], $NC->toArray());
                         $array['constraints']['consequent'] = array_merge_recursive($array['constraints']['consequent'], $NC->toArray());
                         $array['constraints']['condition'] = array_merge_recursive($array['constraints']['condition'], $NC->toArray());
                     } else {
                         $array['constraints'][$scope] = array_merge_recursive($array['constraints'][$scope], $NC->toArray());
                     }
                 }
             } else {
                 $NC->setLevel($level);
                 if ($scope === 'all') {
                     $array['constraints']['antecedent'] = array_merge_recursive($array['constraints']['antecedent'], $NC->toArray());
                     $array['constraints']['consequent'] = array_merge_recursive($array['constraints']['consequent'], $NC->toArray());
                     $array['constraints']['condition'] = array_merge_recursive($array['constraints']['condition'], $NC->toArray());
                 } else {
                     $array['constraints'][$scope] = array_merge_recursive($array['constraints'][$scope], $NC->toArray());
                 }
             }
             */
         }
         if ($scope === 'all') {
             $array['constraints']['antecedent'] = array_merge_recursive($array['constraints']['antecedent'], $NC->toArray());
             $array['constraints']['consequent'] = array_merge_recursive($array['constraints']['consequent'], $NC->toArray());
             $array['constraints']['condition'] = array_merge_recursive($array['constraints']['condition'], $NC->toArray());
         } else {
             $array['constraints'][$scope] = array_merge_recursive($array['constraints'][$scope], $NC->toArray());
         }
     }
     return $array;
 }