2 namespace Consolidation\Config\Loader;
4 class ConfigLoaderTest extends \PHPUnit_Framework_TestCase
6 public function testConfigLoader()
8 $loader = new YamlConfigLoader();
10 // Assert that our test data exists (test the test)
11 $path = __DIR__ . '/data/config-1.yml';
12 $this->assertTrue(file_exists($path));
16 $configFile = basename($loader->getSourceName());
17 $this->assertEquals('config-1.yml', $configFile);
19 // Make sure that the data we loaded contained the expected keys
20 $keys = $loader->keys();
22 $keysString = implode(',', $keys);
23 $this->assertEquals('c,m', $keysString);
25 $configData = $loader->export();
26 $this->assertEquals('foo', $configData['c']);
27 $this->assertEquals('1', $configData['m'][0]);