public function testMultipleSetChildrenFail()
 {
     $regexp = new slRegularExpressionSequence($c1 = new slRegularExpressionElement('a'), $c2 = new slRegularExpressionElement('b'));
     try {
         $regexp->setChildren(array(new StdClass()));
         $this->fail('Expected exception.');
     } catch (Exception $e) {
         /* Expected */
     }
 }
Example #2
0
 /**
  * Visit sequence sub expression
  *
  * The return type of this method varies deping on the concrete visitor 
  * implementation
  * 
  * @param slRegularExpressionSequence $regularExpression 
  * @return mixed
  */
 protected function visitSequence(slRegularExpressionSequence $regularExpression)
 {
     $sequence = $this->document->createElementNS('http://www.w3.org/2001/XMLSchema', 'sequence');
     foreach ($regularExpression->getChildren() as $child) {
         $sequence->appendChild($this->visit($child));
     }
     return $sequence;
 }
Example #3
0
 /**
  * Visit sequence sub expression
  *
  * The return type of this method varies deping on the concrete visitor 
  * implementation
  * 
  * @param slRegularExpressionSequence $regularExpression 
  * @return mixed
  */
 protected function visitSequence(slRegularExpressionSequence $regularExpression)
 {
     return '( ' . implode(', ', array_map(array($this, 'visit'), $regularExpression->getChildren())) . ' )';
 }