Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
Merge pull request #5 from MikaFima/feature/lazy-service-mock
Browse files Browse the repository at this point in the history
Reboot kernel on mock
  • Loading branch information
tyx committed Nov 19, 2014
2 parents 58a00c6 + 0eb3201 commit 1e9b5ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MockContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class MockContainer extends Container
public function overrideService($id, $mock)
{
self::$mockedServices[$id] = $mock;

if ($this->has($id) === true) {
$this->get('kernel')->shutdown();
$this->get('kernel')->boot();
}
}

public function removeMock($id)
Expand Down

0 comments on commit 1e9b5ab

Please sign in to comment.