public function testSetParameters()
 {
     $instance = new ParserParameterProcessor();
     $parameters = array('Foo' => 'Bar');
     $instance->setParameters($parameters);
     $this->assertEquals($parameters, $instance->toArray());
 }
 /**
  * @since 1.9
  *
  * @param ParserParameterProcessor $parameters
  *
  * @return string|null
  */
 public function parse(ParserParameterProcessor $parameters)
 {
     $this->initRecurringEvents($parameters->toArray());
     $this->messageFormatter->addFromArray($this->recurringEvents->getErrors());
     foreach ($this->recurringEvents->getDates() as $date_str) {
         // Override existing parameters array with the returned
         // pre-processed parameters array from recurring events
         $parameters->setParameters($this->recurringEvents->getParameters());
         // Add the date string as individual property / value parameter
         $parameters->addParameter($this->recurringEvents->getProperty(), $date_str);
         // @see SubobjectParserFunction::addDataValuesToSubobject
         // Each new $parameters set will add an additional subobject
         // to the instance
         if ($this->addDataValuesToSubobject($parameters)) {
             $this->parserData->getSemanticData()->addSubobject($this->subobject);
         }
         // Collect errors that occurred during processing
         $this->messageFormatter->addFromArray($this->subobject->getErrors());
     }
     // Update ParserOutput
     $this->parserData->pushSemanticDataToParserOutput();
     return $this->messageFormatter->addFromArray($this->parserData->getErrors())->getHtml();
 }