예제 #1
0
 /**
  * @dataProvider namesProvider
  *
  * @param string|string[] $defaultParameters
  */
 public function testGetDefaultParameters($defaultParameters)
 {
     $definition = new HookDefinition('foo', array(), $defaultParameters);
     $obtainedDefaultParams = $definition->getDefaultParameters();
     $this->assertInternalType('array', $obtainedDefaultParams);
     $this->assertContainsOnly('string', $obtainedDefaultParams);
     $this->assertEquals((array) $defaultParameters, $obtainedDefaultParams);
 }
 private function getProcessedParams(HookDefinition $definition, array $rawParams)
 {
     $processor = Processor::newDefault();
     $processor->setParameters($rawParams, $definition->getParameters());
     $params = array();
     foreach ($processor->processParameters()->getParameters() as $param) {
         $params[$param->getName()] = $param->getValue();
     }
     return $params;
 }