public function testLoadIniFile() { $this->loader->addConfig(__DIR__ . '/contextLoad.xml'); $this->assertEquals('value', $this->context->getIniValue('section.name')); $this->assertEquals(array('value1', 'value2'), $this->context->getIniValue('section.table')); $this->assertEquals('root', $this->context->getIniValue('db.login')); $this->assertEquals('', $this->context->getIniValue('db.password')); }
/** * Evaluate the value definition that can be find in a property definition * @param string $this->value check is the value contenu somthing like ${properyName} and replace the value if needed * @return String */ protected function getValueProperty(ApplicationContext $context, $value) { if (strpos($value, '${') === 0) { $len = strlen($value); if (strrpos($value, '}') === $len - 1) { $propertyName = substr($value, 2, $len - 3); return $context->getIniValue($propertyName); } } return $this->value; }