You've already forked redmine-bundle
use recent file layout and make this stuff work
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
services:
|
||||
Magdev\RedmineBundle\Client\RedmineClient:
|
||||
arguments: ['@redmine_api.cache', '%env(REDMINE_URL)%', '%env(REDMINE_APIKEY)%', '%magdev_redmine.ttl%']
|
||||
|
||||
magdev_redmine.client:
|
||||
class: Magdev\RedmineBundle\Client\RedmineClient
|
||||
@@ -21,27 +21,6 @@ final class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->end();
|
||||
|
||||
#$rootNode->fixXmlConfig('connection')
|
||||
# ->children()
|
||||
# ->arrayNode('connections')
|
||||
# ->useAttributeAsKey('name')
|
||||
# ->normalizeKeys(false)
|
||||
# ->arrayPrototype()
|
||||
# ->children()
|
||||
# ->scalarNode('url')
|
||||
# ->isRequired()
|
||||
# ->info('Base URL of the Redmine instance')
|
||||
# ->end()
|
||||
# ->scalarNode('apikey')
|
||||
# ->isRequired()
|
||||
# ->info('Redmine API-Key')
|
||||
# ->end()
|
||||
# ->end()
|
||||
# ->end()
|
||||
# ->end()
|
||||
# ->scalarNode('default_connection')->end()
|
||||
#;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ final class MagdevRedmineExtension extends Extension
|
||||
|
||||
$container->setParameter('magdev_redmine.ttl', $config['ttl']);
|
||||
|
||||
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader = new YamlFileLoader($container, new FileLocator(dirname(__DIR__).'/../config'));
|
||||
$loader->load('services.yaml');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,23 +17,15 @@ class ConfigurationTest extends TestCase
|
||||
public function testConfig(array $configs): void
|
||||
{
|
||||
$config = (new Processor())->processConfiguration(new Configuration(), $configs);
|
||||
$this->assertSame('foo', $config['connections']['default']['apikey']);
|
||||
$this->assertSame('bar', $config['connections']['default']['url']);
|
||||
$this->assertSame(1800, $config['ttl']);
|
||||
}
|
||||
|
||||
public function configsProvider(): iterable
|
||||
{
|
||||
yield [
|
||||
[
|
||||
'magdev_redmine' => [
|
||||
'connections' => [
|
||||
'default' => [
|
||||
'apikey' => 'foo',
|
||||
'url' => 'bar'
|
||||
],
|
||||
],
|
||||
],
|
||||
yield [[
|
||||
'magdev_redmine' => [
|
||||
'ttl' => 1800
|
||||
],
|
||||
];
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,7 @@ class MagdevRedmineExtensionTest extends TestCase
|
||||
|
||||
(new MagdevRedmineExtension())->load([
|
||||
'magdev_redmine' => [
|
||||
'connections' => [
|
||||
'primary' => ['url' => 'http://foo1', 'apikey' => 'bar1'],
|
||||
'secondary' => ['url' => 'http://foo2', 'apikey' => 'bar2'],
|
||||
],
|
||||
'ttl' => 1800,
|
||||
],
|
||||
], $container);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user