4 * This file is a part of dflydev/dot-access-configuration.
6 * (c) Dragonfly Development Inc.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Dflydev\DotAccessConfiguration;
14 class YamlFileConfigurationBuilderTest extends \PHPUnit_Framework_TestCase
16 public function setUp()
18 if (!class_exists('Symfony\Component\Yaml\Yaml')) {
19 $this->markTestSkipped('The Symfony2 YAML library is not available');
23 public function testBuilder()
25 $configurationBuilder = new YamlFileConfigurationBuilder(array(__DIR__.'/fixtures/yamlFileConfigurationBuilderTest-testBuilder.yml'));
27 $configuration = $configurationBuilder->build();
29 $this->assertEquals('C', $configuration->get('a.b.c'));
30 $this->assertEquals('C0', $configuration->get('a0.b0.c0'));
31 $this->assertEquals('C1', $configuration->get('a1.b1.c1'));
32 $this->assertEquals(array(
33 'yamlFileConfigurationBuilderTest-testBuilder-import-level0.yml',
34 '/tmp/testing-this-file-should-not-exist.yml',
35 'yamlFileConfigurationBuilderTest-testBuilder-import-level1.yml',
36 ), $configuration->get('imports'));