Skip to content

Commit b5ee5d4

Browse files
committed
Fix tests import with name into container
1 parent 2c93875 commit b5ee5d4

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/Helper/User/UserMailer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace Silverback\ApiComponentsBundle\Helper\User;
1515

16-
use Doctrine\ORM\EntityManagerInterface;
1716
use Psr\Container\ContainerInterface;
1817
use Silverback\ApiComponentsBundle\Entity\User\AbstractUser;
1918
use Silverback\ApiComponentsBundle\Exception\MailerTransportException;
@@ -50,7 +49,7 @@ public function sendPasswordResetEmail(AbstractUser $user): bool
5049

5150
if ($email) {
5251
$user->setPasswordRequestedAt(new \DateTime());
53-
$this->container->get(EntityManagerInterface::class)->flush();
52+
$this->container->get('doctrine.orm.entity_manager')->flush();
5453
}
5554

5655
return $this->send($email);
@@ -62,7 +61,7 @@ public function sendChangeEmailConfirmationEmail(AbstractUser $user): bool
6261

6362
if ($email) {
6463
$user->setNewEmailAddressChangeRequestedAt(new \DateTime());
65-
$this->container->get(EntityManagerInterface::class)->flush();
64+
$this->container->get('doctrine.orm.entity_manager')->flush();
6665
}
6766

6867
return $this->send($email);
@@ -74,7 +73,7 @@ public function sendEmailVerifyEmail(AbstractUser $user): bool
7473

7574
if ($email) {
7675
$user->setEmailAddressVerificationRequestedAt(new \DateTime());
77-
$this->container->get(EntityManagerInterface::class)->flush();
76+
$this->container->get('doctrine.orm.entity_manager')->flush();
7877
}
7978

8079
return $this->send($email);

src/Resources/config/services.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,8 +1192,8 @@
11921192
UsernameChangedEmailFactory::class => new Reference(UsernameChangedEmailFactory::class),
11931193
PasswordChangedEmailFactory::class => new Reference(PasswordChangedEmailFactory::class),
11941194
VerifyEmailFactory::class => new Reference(VerifyEmailFactory::class),
1195+
'doctrine.orm.entity_manager' => new Reference('doctrine.orm.entity_manager'),
11951196
'logger' => new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE),
1196-
new Reference(EntityManagerInterface::class),
11971197
]),
11981198
'', // injected in dependency injection
11991199
]

tests/Helper/User/UserMailerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private function createEmMockExpectation(): array
215215

216216
return [
217217
[
218-
EntityManagerInterface::class,
218+
'doctrine.orm.entity_manager',
219219
$emMock,
220220
],
221221
];

0 commit comments

Comments
 (0)