Skip to content

Commit

Permalink
Closed #44.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidePastore committed Sep 1, 2015
1 parent f1f35d3 commit bd6775e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($path)
$parser = $this->getParser($extension);

// Try and load file
$this->data = array_replace_recursive($this->data, $parser->parse($path));
$this->data = array_replace_recursive($this->data, (array) $parser->parse($path));
}

parent::__construct($this->data);
Expand Down
16 changes: 16 additions & 0 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ public function testConstructWithYml()

$this->assertEquals($expected, $actual);
}

/**
* @covers Noodlehaus\Config::__construct()
* @covers Noodlehaus\Config::getParser()
* @covers Noodlehaus\Config::getPathFromArray()
* @covers Noodlehaus\Config::getValidPath()
*/
public function testConstructWithEmptyYml()
{
$config = new Config(__DIR__ . '/mocks/pass/empty.yaml');

$expected = array();
$actual = $config->all();

$this->assertEquals($expected, $actual);
}

/**
* @covers Noodlehaus\Config::__construct()
Expand Down
Empty file added tests/mocks/pass/empty.yaml
Empty file.

0 comments on commit bd6775e

Please sign in to comment.