You've already forked redmine-bundle
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ecb3a36f48 | |||
| 8948ddf01b | |||
| cf753aaa20 |
@@ -21,9 +21,9 @@ final class Configuration implements ConfigurationInterface
|
|||||||
->normalizeKeys(false)
|
->normalizeKeys(false)
|
||||||
->arrayPrototype()
|
->arrayPrototype()
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('baseurl')
|
->scalarNode('url')
|
||||||
->isRequired()
|
->isRequired()
|
||||||
->info('The base URL of your redmine instance')
|
->info('The URL of your Redmine instance')
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('apikey')
|
->scalarNode('apikey')
|
||||||
->isRequired()
|
->isRequired()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ final class MagdevRedmineExtension extends Extension
|
|||||||
foreach ($config['connections'] as $name => $connection) {
|
foreach ($config['connections'] as $name => $connection) {
|
||||||
$id = sprintf('magdev.redmine.%s', $name);
|
$id = sprintf('magdev.redmine.%s', $name);
|
||||||
$container->register($id, NativeCurlClient::class)
|
$container->register($id, NativeCurlClient::class)
|
||||||
->setArguments([$connection['baseurl'], $connection['apikey']]);
|
->setArguments([$connection['url'], $connection['apikey']]);
|
||||||
$container->registerAliasForArgument($id, NativeCurlClient::class, "{$name}Client");
|
$container->registerAliasForArgument($id, NativeCurlClient::class, "{$name}Client");
|
||||||
|
|
||||||
if ($name === $config['default_connection']) {
|
if ($name === $config['default_connection']) {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ 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']['token']);
|
$this->assertSame('foo', $config['connections']['default']['apikey']);
|
||||||
$this->assertSame('bar', $config['connections']['default']['baseurl']);
|
$this->assertSame('bar', $config['connections']['default']['url']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configsProvider(): iterable
|
public function configsProvider(): iterable
|
||||||
@@ -28,8 +28,8 @@ class ConfigurationTest extends TestCase
|
|||||||
'magdev_redmine' => [
|
'magdev_redmine' => [
|
||||||
'connections' => [
|
'connections' => [
|
||||||
'default' => [
|
'default' => [
|
||||||
'token' => 'foo',
|
'apikey' => 'foo',
|
||||||
'baseurl' => 'bar'
|
'url' => 'bar'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ class MagdevRedmineExtensionTest extends TestCase
|
|||||||
(new MagdevRedmineExtension())->load([
|
(new MagdevRedmineExtension())->load([
|
||||||
'magdev_redmine' => [
|
'magdev_redmine' => [
|
||||||
'connections' => [
|
'connections' => [
|
||||||
'primary' => ['baseurl' => 'http://foo1', 'token' => 'bar1'],
|
'primary' => ['url' => 'http://foo1', 'apikey' => 'bar1'],
|
||||||
'secondary' => ['baseurl' => 'http://foo2', 'token' => 'bar2'],
|
'secondary' => ['url' => 'http://foo2', 'apikey' => 'bar2'],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
], $container);
|
], $container);
|
||||||
|
|||||||
Reference in New Issue
Block a user