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:
|
services:
|
||||||
Magdev\RedmineBundle\Client\RedmineClient:
|
Magdev\RedmineBundle\Client\RedmineClient:
|
||||||
arguments: ['@redmine_api.cache', '%env(REDMINE_URL)%', '%env(REDMINE_APIKEY)%', '%magdev_redmine.ttl%']
|
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()
|
||||||
->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;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ final class MagdevRedmineExtension extends Extension
|
|||||||
|
|
||||||
$container->setParameter('magdev_redmine.ttl', $config['ttl']);
|
$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');
|
$loader->load('services.yaml');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,23 +17,15 @@ class ConfigurationTest extends TestCase
|
|||||||
public function testConfig(array $configs): void
|
public function testConfig(array $configs): void
|
||||||
{
|
{
|
||||||
$config = (new Processor())->processConfiguration(new Configuration(), $configs);
|
$config = (new Processor())->processConfiguration(new Configuration(), $configs);
|
||||||
$this->assertSame('foo', $config['connections']['default']['apikey']);
|
$this->assertSame(1800, $config['ttl']);
|
||||||
$this->assertSame('bar', $config['connections']['default']['url']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configsProvider(): iterable
|
public function configsProvider(): iterable
|
||||||
{
|
{
|
||||||
yield [
|
yield [[
|
||||||
[
|
'magdev_redmine' => [
|
||||||
'magdev_redmine' => [
|
'ttl' => 1800
|
||||||
'connections' => [
|
|
||||||
'default' => [
|
|
||||||
'apikey' => 'foo',
|
|
||||||
'url' => 'bar'
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
];
|
]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,7 @@ class MagdevRedmineExtensionTest extends TestCase
|
|||||||
|
|
||||||
(new MagdevRedmineExtension())->load([
|
(new MagdevRedmineExtension())->load([
|
||||||
'magdev_redmine' => [
|
'magdev_redmine' => [
|
||||||
'connections' => [
|
'ttl' => 1800,
|
||||||
'primary' => ['url' => 'http://foo1', 'apikey' => 'bar1'],
|
|
||||||
'secondary' => ['url' => 'http://foo2', 'apikey' => 'bar2'],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
], $container);
|
], $container);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user