public function testAddAndRemoveParameter()
 {
     $instance = new ParserParameterProcessor();
     $instance->addParameter('Foo', 'Bar');
     $this->assertEquals(array('Foo' => array('Bar')), $instance->toArray());
     $instance->removeParameterByKey('Foo');
     $this->assertFalse($instance->hasParameter('Foo'));
 }
 private function doPrepareParameters(ParserParameterProcessor $parserParameterProcessor)
 {
     if ($parserParameterProcessor->hasParameter(self::PARAM_LINKWITH)) {
         $val = $parserParameterProcessor->getParameterValuesByKey(self::PARAM_LINKWITH);
         $parserParameterProcessor->addParameter(end($val), $this->parserData->getTitle()->getPrefixedText());
         $parserParameterProcessor->removeParameterByKey(self::PARAM_LINKWITH);
     }
     if ($this->isEnabledFirstElementAsPropertyLabel) {
         $parserParameterProcessor->addParameter($parserParameterProcessor->getFirst(), $this->parserData->getTitle()->getPrefixedText());
     }
     $parameters = $parserParameterProcessor->toArray();
     // FIXME 3.0 make sorting default by 3.0
     // Only sort for a modified sobj otherwise existing ID will change
     $sort = false;
     // This ensures that an unordered array is ordered and will produce
     // the same ID even if elements are placed differently
     if ($sort) {
         ksort($parameters);
     }
     return $parameters;
 }