<?php

namespace Ingot\Tests\Normalizer;

use Ingot\Normalizer\NetGroupNormalizer;
use Symfony\Component\Config\FileLocator;

class NetGroupNormalizerTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $locator = new FileLocator(__DIR__ . '/../Fixtures');
        $this->normalizer = new NetGroupNormalizer($locator);
    }

    /**
     * @dataProvider normalizationStrings
     * @test
     */
    public function it_normalizes_based_on_file($pattern, $expected)
    {
        $this->assertEquals($expected, $this->normalizer->normalize($pattern));
    }

    public function normalizationStrings()
    {
        return array(
            array("value", "value"),
            array("#symfony.redis.host#", "stage-redis01"),
            array("#symfony.redis.port#", 6379),
            array("#app.name#", "grundfos-lion"),
            array("#app.type#", "symfony"),
            array("#app.env.APP_BRANCH#", "ng"),
        );
    }
}
