6dedb1f36b56a57a29865c17db930893ec9b5592
[yaffs-website] / vendor / consolidation / config / tests / ConfigLoaderTest.php
1 <?php
2 namespace Consolidation\Config\Loader;
3
4 class ConfigLoaderTest extends \PHPUnit_Framework_TestCase
5 {
6     public function testConfigLoader()
7     {
8         $loader = new YamlConfigLoader();
9
10         // Assert that our test data exists (test the test)
11         $path = __DIR__ . '/data/config-1.yml';
12         $this->assertTrue(file_exists($path));
13
14         $loader->load($path);
15
16         $configFile = basename($loader->getSourceName());
17         $this->assertEquals('config-1.yml', $configFile);
18
19         // Make sure that the data we loaded contained the expected keys
20         $keys = $loader->keys();
21         sort($keys);
22         $keysString = implode(',', $keys);
23         $this->assertEquals('c,m', $keysString);
24
25         $configData = $loader->export();
26         $this->assertEquals('foo', $configData['c']);
27         $this->assertEquals('1', $configData['m'][0]);
28     }
29 }