Files
redmine-bundle/tests/DependencyInjection/ConfigurationTest.php

40 lines
1.1 KiB
PHP
Raw Normal View History

2023-04-25 15:09:11 +02:00
<?php declare(strict_types=1);
2023-04-25 15:00:03 +02:00
namespace Magdev\RedmineBundle\Tests\DependencyInjection;
use Magdev\RedmineBundle\DependencyInjection\Configuration;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Definition\Processor;
/**
* @author Marco Grätsch <magdev3.0@gmail.com>
*/
class ConfigurationTest extends TestCase
{
/**
* @dataProvider configsProvider
*/
public function testConfig(array $configs): void
{
$config = (new Processor())->processConfiguration(new Configuration(), $configs);
2023-04-29 09:07:57 +02:00
$this->assertSame('foo', $config['connections']['default']['apikey']);
$this->assertSame('bar', $config['connections']['default']['url']);
2023-04-25 15:00:03 +02:00
}
public function configsProvider(): iterable
{
yield [
[
'magdev_redmine' => [
'connections' => [
'default' => [
2023-04-29 09:07:57 +02:00
'apikey' => 'foo',
'url' => 'bar'
2023-04-25 15:00:03 +02:00
],
],
],
],
];
}
}