Skip to content

Commit

Permalink
Load environment configuration from testbench.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jul 4, 2014
1 parent 003439e commit 92b8f69
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Testbench/Traits/ApplicationTrait.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Orchestra\Testbench\Traits;

use Illuminate\Config\EnvironmentVariables;
use Illuminate\Config\Repository as Config;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\AliasLoader;
Expand Down Expand Up @@ -151,8 +152,8 @@ public function createApplication()
$app = new Application;

$app->detectEnvironment(array(
'local' => array('your-machine-name'),
));
'local' => array('your-machine-name'),
));

$app->bindInstallPaths($this->getApplicationPaths());

Expand All @@ -163,8 +164,11 @@ public function createApplication()
Facade::clearResolvedInstances();
Facade::setFacadeApplication($app);

$config = new Config($app->getConfigLoader(), $app['env']);
$app->instance('config', $config);
$app->registerCoreContainerAliases();

with($envVariables = new EnvironmentVariables($app->getEnvironmentVariablesLoader()))->load($app['env']);

$app->instance('config', $config = new Config($app->getConfigLoader(), $app['env']));
$app->startExceptionHandling();

date_default_timezone_set($this->getApplicationTimezone());
Expand Down

0 comments on commit 92b8f69

Please sign in to comment.