/** * @param Zend_Config $testConfig * @param ReflectionParameter $arg * @throws Exception * @throws KalturaTestException * @return Ambigous */ protected function getArgConfig(Zend_Config $testConfig, ReflectionParameter $arg) { $argName = $arg->getName(); $argConfig = $testConfig->get($argName); if (!$argConfig) { if (!$arg->allowsNull()) { throw new Exception("Argument [{$argName}] can't be null for test [" . $testConfig->getSectionName() . "]"); } return null; } if (is_string($argConfig)) { return $argConfig; } switch ($argConfig->objectType) { case 'dependency': throw new KalturaTestException("Argument [{$argName}] taken from dependency"); case 'array': return $this->populateArray($argConfig); case 'native': return $argConfig->value; case 'file': return $argConfig->path; default: return $this->populateObject($argConfig); } }