Skip to content

Commit

Permalink
test_apply
Browse files Browse the repository at this point in the history
  • Loading branch information
wogsland committed Jul 2, 2015
1 parent 819a3c2 commit 84829dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Boris/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public function __construct($searchPaths = null, $cascade = false)

/**
* Searches for configuration files in the available
* search paths, and applies them to the provided
* boris instance.
* search paths, and applies them.
*
* Returns true if any configuration files were found.
*
Expand Down
13 changes: 13 additions & 0 deletions tests/lib/Boris/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,20 @@ public function test_constructor_params () {
* Tests the apply method.
*/
public function test_apply () {
//setup
$test_file_to_apply = getcwd() . '/tests/requirable.php';
$test_file_to_apply2 = getcwd() . '/tests/requirable2.php';
$files = array($test_file_to_apply, $test_file_to_apply2);

// without cascade
$Config = new Config($files);
$Config->apply();
$this->assertEquals(getenv('REQUIRED_MESSAGE'), 'You successfully required the file!');

// with cascade
$Config = new Config($files, true);
$Config->apply();
$this->assertEquals(getenv('REQUIRED_MESSAGE'), 'You successfully required the 2nd file!');
}

/**
Expand Down

0 comments on commit 84829dc

Please sign in to comment.