Fix new CS

This commit is contained in:
2023-09-06 16:18:28 +02:00
parent bc5c420f92
commit 34ee2b3ba5
5 changed files with 25 additions and 13 deletions

View File

@@ -1,5 +1,14 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Notification\Email;
use Chill\MainBundle\Entity\Notification;
@@ -16,6 +25,10 @@ use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
use Symfony\Component\Translation\Translator;
/**
* @internal
* @coversNothing
*/
class NotificationMailerTest extends TestCase
{
use ProphecyTrait;
@@ -35,7 +48,7 @@ class NotificationMailerTest extends TestCase
->setSender($user1)
->addAddressee($user2)
->addAddressee($user3)
;
;
$comment = (new NotificationComment())
->setContent("foo bar baz")
@@ -47,14 +60,14 @@ class NotificationMailerTest extends TestCase
// a mail only to user1 and user3 should have been sent
$mailer->send(Argument::that(function (Email $email) {
foreach ($email->getTo() as $address) {
if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') {
return true;
}
foreach ($email->getTo() as $address) {
if ($address->getAddress() === 'user1@foo.com' || $address->getAddress() === 'user3@foo.com') {
return true;
}
}
return false;
}));
return false;
}));
$objectManager = $this->prophesize(EntityManagerInterface::class);
@@ -104,8 +117,7 @@ class NotificationMailerTest extends TestCase
private function buildNotificationMailer(
MailerInterface $mailer = null,
): NotificationMailer
{
): NotificationMailer {
return new NotificationMailer(
$mailer,
new NullLogger(),