Skip to content

Commit

Permalink
Fix a test that wasn't mocking enough (#590)
Browse files Browse the repository at this point in the history
The implementation of the ManagerRegistry resetService started
using another method of the Container interface that wasn't mocked
and it broke the tests. The initialized method.
This PR just mock that method in the relevant tests.
  • Loading branch information
mikeSimonson committed Dec 5, 2016
1 parent 7b72a8e commit ff56eb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/RegistryTest.php
Expand Up @@ -119,6 +119,10 @@ public function testGetUnknownEntityManager()
public function testResetDefaultEntityManager()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container->expects($this->any())
->method('initialized')
->with($this->equalTo('doctrine.orm.default_entity_manager'))
->willReturn(true);
$container->expects($this->once())
->method('set')
->with($this->equalTo('doctrine.orm.default_entity_manager'), $this->equalTo(null));
Expand All @@ -130,6 +134,10 @@ public function testResetDefaultEntityManager()
public function testResetEntityManager()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container->expects($this->any())
->method('initialized')
->with($this->equalTo('doctrine.orm.default_entity_manager'))
->willReturn(true);
$container->expects($this->once())
->method('set')
->with($this->equalTo('doctrine.orm.default_entity_manager'), $this->equalTo(null));
Expand Down

0 comments on commit ff56eb9

Please sign in to comment.