Skip to content

Commit 1d54435

Browse files
committed
Fix: tests
1 parent 65921b7 commit 1d54435

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

src/Subscription/Controller/SubscriberController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ public function updateSubscriber(
169169
}
170170
/** @var UpdateSubscriberRequest $updateSubscriberRequest */
171171
$updateSubscriberRequest = $this->validator->validate($request, UpdateSubscriberRequest::class);
172-
$subscriber = $this->subscriberManager->updateSubscriber($subscriber, $updateSubscriberRequest->getDto(), $admin);
172+
$subscriber = $this->subscriberManager->updateSubscriber(
173+
subscriber: $subscriber,
174+
subscriberDto: $updateSubscriberRequest->getDto(),
175+
admin: $admin
176+
);
173177
$this->entityManager->flush();
174178
$subscriberData = $this->subscriberNormalizer->normalize($subscriber, 'json');
175179

src/Subscription/Request/UpdateSubscriberRequest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
)]
2727
class UpdateSubscriberRequest implements RequestInterface
2828
{
29-
public int $subscriberId;
30-
3129
#[Assert\NotBlank]
3230
#[Assert\Email]
3331
#[UniqueEmail(entityClass: Subscriber::class)]
@@ -51,7 +49,6 @@ class UpdateSubscriberRequest implements RequestInterface
5149
public function getDto(): UpdateSubscriberDto
5250
{
5351
return new UpdateSubscriberDto(
54-
subscriberId: $this->subscriberId,
5552
email: $this->email,
5653
confirmed: $this->confirmed,
5754
blacklisted: $this->blacklisted,

tests/Unit/Identity/Request/UpdateAdministratorRequestTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class UpdateAdministratorRequestTest extends TestCase
1313
public function testGetDtoReturnsCorrectDto(): void
1414
{
1515
$request = new UpdateAdministratorRequest();
16-
$request->administratorId = 123;
1716
$request->loginName = 'testuser';
1817
$request->password = 'password123';
1918
$request->email = 'test@example.com';
@@ -27,7 +26,6 @@ public function testGetDtoReturnsCorrectDto(): void
2726

2827
$dto = $request->getDto();
2928

30-
$this->assertEquals(123, $dto->administratorId);
3129
$this->assertEquals('testuser', $dto->loginName);
3230
$this->assertEquals('password123', $dto->password);
3331
$this->assertEquals('test@example.com', $dto->email);
@@ -43,11 +41,9 @@ public function testGetDtoReturnsCorrectDto(): void
4341
public function testGetDtoWithNullValues(): void
4442
{
4543
$request = new UpdateAdministratorRequest();
46-
$request->administratorId = 456;
4744

4845
$dto = $request->getDto();
4946

50-
$this->assertEquals(456, $dto->administratorId);
5147
$this->assertNull($dto->loginName);
5248
$this->assertNull($dto->password);
5349
$this->assertNull($dto->email);

tests/Unit/Messaging/Request/UpdateMessageRequestTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ protected function setUp(): void
5353
$scheduleRequest->method('getDto')->willReturn($this->scheduleDto);
5454

5555
$this->request = new UpdateMessageRequest();
56-
$this->request->messageId = 123;
5756
$this->request->content = $contentRequest;
5857
$this->request->format = $formatRequest;
5958
$this->request->metadata = $metadataRequest;
@@ -68,7 +67,6 @@ public function testGetDtoReturnsCorrectDto(): void
6867
$dto = $this->request->getDto();
6968

7069
$this->assertInstanceOf(UpdateMessageDto::class, $dto);
71-
$this->assertEquals(123, $dto->messageId);
7270
$this->assertSame($this->contentDto, $dto->content);
7371
$this->assertSame($this->formatDto, $dto->format);
7472
$this->assertSame($this->metadataDto, $dto->metadata);
@@ -84,7 +82,6 @@ public function testGetDtoWithNullTemplateId(): void
8482
$dto = $this->request->getDto();
8583

8684
$this->assertInstanceOf(UpdateMessageDto::class, $dto);
87-
$this->assertEquals(123, $dto->messageId);
8885
$this->assertSame($this->contentDto, $dto->content);
8986
$this->assertSame($this->formatDto, $dto->format);
9087
$this->assertSame($this->metadataDto, $dto->metadata);

tests/Unit/Subscription/Request/UpdateSubscriberRequestTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class UpdateSubscriberRequestTest extends TestCase
1313
public function testGetDtoReturnsCorrectDto(): void
1414
{
1515
$request = new UpdateSubscriberRequest();
16-
$request->subscriberId = 123;
1716
$request->email = 'subscriber@example.com';
1817
$request->confirmed = true;
1918
$request->blacklisted = false;
@@ -24,7 +23,6 @@ public function testGetDtoReturnsCorrectDto(): void
2423
$dto = $request->getDto();
2524

2625
$this->assertInstanceOf(UpdateSubscriberDto::class, $dto);
27-
$this->assertEquals(123, $dto->subscriberId);
2826
$this->assertEquals('subscriber@example.com', $dto->email);
2927
$this->assertTrue($dto->confirmed);
3028
$this->assertFalse($dto->blacklisted);

0 commit comments

Comments
 (0)