public function toArray()
{
$result = Yaml::parse($this->buffer);
if (!is_array($result)) {
throw new RuntimeException(sprintf("Failed to parse config-file '%s'", $this->path));
}
return $result;
}
/** * @test * @expectedException RuntimeException * @expectedExceptionMessage Failed to parse config-file 'data://,' */ public function parseEmptyFile() { $configFile = new ConfigFile(); $configFile->loadFile('data://,'); $this->addToAssertionCount(1); $configFile->toArray(); $this->fail('An expected exception has not been thrown.'); }