Skip to content

Commit

Permalink
Make getAlias() public on container. (#15444)
Browse files Browse the repository at this point in the history
  • Loading branch information
garygreen authored and taylorotwell committed Sep 15, 2016
1 parent 9ae949f commit 1f4e055
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ protected function isBuildable($concrete, $abstract)
* @param string $abstract
* @return string
*/
protected function getAlias($abstract)
public function getAlias($abstract)
{
if (! isset($this->aliases[$abstract])) {
return $abstract;
Expand Down
7 changes: 7 additions & 0 deletions tests/Container/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,13 @@ public function testResolvedResolvesAliasToBindingNameBeforeChecking()
$this->assertTrue($container->resolved('foo'));
}

public function testGetAlias()
{
$container = new Container;
$container->alias('ConcreteStub', 'foo');
$this->assertEquals($container->getAlias('foo'), 'ConcreteStub');
}

public function testContainerCanInjectSimpleVariable()
{
$container = new Container;
Expand Down

0 comments on commit 1f4e055

Please sign in to comment.