File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
src/Domain/Subscription/Service/Manager
tests/Unit/Domain/Subscription/Service/Manager Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 404404 <target >Another attribute with this name already exists.</target >
405405 </trans-unit >
406406
407+ <trans-unit id =" subscription.subscriber_page_not_found" >
408+ <source >Subscribe page not found</source >
409+ <target >Subscribe page not found</target >
410+ </trans-unit >
411+
407412 </body >
408413 </file >
409414</xliff >
Original file line number Diff line number Diff line change 1111use PhpList \Core \Domain \Subscription \Repository \SubscriberPageDataRepository ;
1212use PhpList \Core \Domain \Subscription \Repository \SubscriberPageRepository ;
1313use Symfony \Component \HttpKernel \Exception \NotFoundHttpException ;
14+ use Symfony \Contracts \Translation \TranslatorInterface ;
1415
1516class SubscribePageManager
1617{
1718 public function __construct (
1819 private readonly SubscriberPageRepository $ pageRepository ,
1920 private readonly SubscriberPageDataRepository $ pageDataRepository ,
2021 private readonly EntityManagerInterface $ entityManager ,
22+ private readonly TranslatorInterface $ translator ,
2123 ) {
2224 }
2325
@@ -41,7 +43,7 @@ public function getPage(int $id): SubscribePage
4143 /** @var SubscribePage|null $page */
4244 $ page = $ this ->pageRepository ->find ($ id );
4345 if (!$ page ) {
44- throw new NotFoundHttpException ('Subscribe page not found ' );
46+ throw new NotFoundHttpException ($ this -> translator -> trans ( 'Subscribe page not found ' ) );
4547 }
4648
4749 return $ page ;
Original file line number Diff line number Diff line change 1414use PHPUnit \Framework \MockObject \MockObject ;
1515use PHPUnit \Framework \TestCase ;
1616use Symfony \Component \HttpKernel \Exception \NotFoundHttpException ;
17+ use Symfony \Component \Translation \Translator ;
1718
1819class SubscribePageManagerTest extends TestCase
1920{
@@ -32,6 +33,7 @@ protected function setUp(): void
3233 pageRepository: $ this ->pageRepository ,
3334 pageDataRepository: $ this ->pageDataRepository ,
3435 entityManager: $ this ->entityManager ,
36+ translator: new Translator ('en ' ),
3537 );
3638 }
3739
You can’t perform that action at this time.
0 commit comments