Skip to content

Commit

Permalink
Add Kernel::getEnvironment()
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Jul 16, 2017
1 parent 29fa291 commit 962c9dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ public function createContainer() : Container
return $containerBuilder->build();
}

public function getEnvironment() : string
{
return $this->environment;
}

/**
* Override this method to customize the container builder before it is used.
*/
Expand Down
8 changes: 8 additions & 0 deletions tests/KernelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,12 @@ public function uses_provided_config()
$this->assertEquals('biz', $container->get('foo'));
$this->assertEquals('bar', $container->get('bar'));
}

/** @test */
public function exposes_the_environment()
{
$this->kernel = new Kernel;

$this->assertEquals('prod', $this->kernel->getEnvironment());
}
}

0 comments on commit 962c9dc

Please sign in to comment.