Skip to content

Commit

Permalink
Merge branch '1.12.x' into 2.0.x
Browse files Browse the repository at this point in the history
* 1.12.x:
  Fix error when resetting manager registry
  • Loading branch information
alcaeus committed Dec 18, 2019
2 parents 651107e + f7f32a3 commit fd15f18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Registry.php
Expand Up @@ -50,7 +50,7 @@ public function getAliasNamespace($alias)

public function reset() : void
{
foreach ($this->getManagerNames() as $managerName) {
foreach (array_keys($this->getManagerNames()) as $managerName) {
$this->resetManager($managerName);
}
}
Expand Down
16 changes: 16 additions & 0 deletions Tests/RegistryTest.php
Expand Up @@ -122,4 +122,20 @@ public function testResetUnknownEntityManager()

$registry->resetManager('default');
}

/**
* @group legacy
*/
public function testReset()
{
$em = new stdClass();
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->once())
->method('get')
->with($this->equalTo('doctrine.orm.default_entity_manager'))
->will($this->returnValue($em));

$registry = new Registry($container, [], ['default' => 'doctrine.orm.default_entity_manager'], 'default', 'default');
$registry->reset();
}
}

0 comments on commit fd15f18

Please sign in to comment.