Skip to content

Commit

Permalink
append test. changed php version
Browse files Browse the repository at this point in the history
  • Loading branch information
ytake committed Nov 22, 2016
1 parent bdb5acb commit 09e6978
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=5.6.4",
"php": ">=5.5.9",
"illuminate/console": "~5.0",
"illuminate/filesystem": "~5.0",
"illuminate/support": "~5.0",
Expand Down
17 changes: 12 additions & 5 deletions tests/ResolveInstanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ class ResolveInstanceTest extends AspectTestCase
protected function setUp()
{
parent::setUp();

$this->app->bind('a', ResolveMockClass::class);

$this->app->bind(ResolveMockInterface::class, ResolveMockClass::class);

$this->manager = new \Ytake\LaravelAspect\AspectManager($this->app);
$this->resolveManager();
}

public function testShouldReturnBindingConcreteClass()
{
$this->app->bind('a', ResolveMockClass::class);

$this->app->bind(ResolveMockInterface::class, ResolveMockClass::class);

$resolve = $this->app->make(ResolveMockInterface::class);
$resolve->get();
$this->assertSame(
Expand All @@ -31,7 +30,15 @@ public function testShouldReturnBindingConcreteClass()
$this->assertInstanceOf(get_class($resolve), $this->app->make('a'));
}

public function testShouldReturnSameInstanceForShared()
{
$this->app->singleton(ResolveMockInterface::class, ResolveMockClass::class);
$resolve = $this->app->make(ResolveMockInterface::class);
$this->assertSame($resolve, $this->app->make(ResolveMockInterface::class));
}

/**
*
*
*/
protected function resolveManager()
Expand Down

0 comments on commit 09e6978

Please sign in to comment.