1111use PhpList \Core \Domain \Subscription \Service \Manager \AttributeDefinitionManager ;
1212use PhpList \Core \Domain \Subscription \Validator \AttributeTypeValidator ;
1313use PHPUnit \Framework \TestCase ;
14+ use Symfony \Component \Translation \Translator ;
1415
1516class AttributeDefinitionManagerTest extends TestCase
1617{
1718 public function testCreateAttributeDefinition (): void
1819 {
1920 $ repository = $ this ->createMock (SubscriberAttributeDefinitionRepository::class);
2021 $ validator = $ this ->createMock (AttributeTypeValidator::class);
21- $ manager = new AttributeDefinitionManager ($ repository , $ validator );
22+ $ manager = new AttributeDefinitionManager (
23+ definitionRepository: $ repository ,
24+ attributeTypeValidator: $ validator ,
25+ translator: new Translator ('en ' )
26+ );
2227
2328 $ dto = new AttributeDefinitionDto (
2429 name: 'Country ' ,
@@ -51,7 +56,11 @@ public function testCreateThrowsWhenAttributeAlreadyExists(): void
5156 {
5257 $ repository = $ this ->createMock (SubscriberAttributeDefinitionRepository::class);
5358 $ validator = $ this ->createMock (AttributeTypeValidator::class);
54- $ manager = new AttributeDefinitionManager ($ repository , $ validator );
59+ $ manager = new AttributeDefinitionManager (
60+ definitionRepository: $ repository ,
61+ attributeTypeValidator: $ validator ,
62+ translator: new Translator ('en ' ),
63+ );
5564
5665 $ dto = new AttributeDefinitionDto (
5766 name: 'Country ' ,
@@ -78,7 +87,11 @@ public function testUpdateAttributeDefinition(): void
7887 {
7988 $ repository = $ this ->createMock (SubscriberAttributeDefinitionRepository::class);
8089 $ validator = $ this ->createMock (AttributeTypeValidator::class);
81- $ manager = new AttributeDefinitionManager ($ repository , $ validator );
90+ $ manager = new AttributeDefinitionManager (
91+ definitionRepository: $ repository ,
92+ attributeTypeValidator: $ validator ,
93+ translator: new Translator ('en ' ),
94+ );
8295
8396 $ attribute = new SubscriberAttributeDefinition ();
8497 $ attribute ->setName ('Old ' );
@@ -113,7 +126,11 @@ public function testUpdateThrowsWhenAnotherAttributeWithSameNameExists(): void
113126 {
114127 $ repository = $ this ->createMock (SubscriberAttributeDefinitionRepository::class);
115128 $ validator = $ this ->createMock (AttributeTypeValidator::class);
116- $ manager = new AttributeDefinitionManager ($ repository , $ validator );
129+ $ manager = new AttributeDefinitionManager (
130+ definitionRepository: $ repository ,
131+ attributeTypeValidator: $ validator ,
132+ translator: new Translator ('en ' ),
133+ );
117134
118135 $ dto = new AttributeDefinitionDto (
119136 name: 'Existing ' ,
@@ -144,7 +161,11 @@ public function testDeleteAttributeDefinition(): void
144161 {
145162 $ repository = $ this ->createMock (SubscriberAttributeDefinitionRepository::class);
146163 $ validator = $ this ->createMock (AttributeTypeValidator::class);
147- $ manager = new AttributeDefinitionManager ($ repository , $ validator );
164+ $ manager = new AttributeDefinitionManager (
165+ definitionRepository: $ repository ,
166+ attributeTypeValidator: $ validator ,
167+ translator: new Translator ('en ' ),
168+ );
148169
149170 $ attribute = new SubscriberAttributeDefinition ();
150171
0 commit comments