4e63b0391e489c4dff0deb5dc889fc06bcd480b6
[yaffs-website] / vendor / dflydev / dot-access-configuration / tests / Dflydev / DotAccessConfiguration / YamlFileConfigurationBuilderTest.php
1 <?php
2
3 /*
4  * This file is a part of dflydev/dot-access-configuration.
5  * 
6  * (c) Dragonfly Development Inc.
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Dflydev\DotAccessConfiguration;
13
14 class YamlFileConfigurationBuilderTest extends \PHPUnit_Framework_TestCase
15 {
16     public function setUp()
17     {
18         if (!class_exists('Symfony\Component\Yaml\Yaml')) {
19             $this->markTestSkipped('The Symfony2 YAML library is not available');
20         }
21     }
22
23     public function testBuilder()
24     {
25         $configurationBuilder = new YamlFileConfigurationBuilder(array(__DIR__.'/fixtures/yamlFileConfigurationBuilderTest-testBuilder.yml'));
26
27         $configuration = $configurationBuilder->build();
28
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'));
37     }
38 }