Skip to content

Commit 49a8926

Browse files
committed
ISSUE-345: phpstan + phpcs fix
1 parent e2fb0d4 commit 49a8926

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

tests/Integration/Controller/SubscriptionControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testCreateSubscriptionWithValidEmailsReturns201(): void
5454

5555
$payload = json_encode(['emails' => ['[email protected]']]);
5656

57-
$this->authenticatedJsonRequest('POST', '/api/v2/lists/1/subscribers', [], [], [], $payload);
57+
$this->authenticatedJsonRequest('POST', '/api/v2/lists/1/subscribers', [], [], [], $payload);
5858
$this->assertHttpCreated();
5959
}
6060

tests/Unit/Service/Manager/SubscriberListManagerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
use PhpList\Core\Domain\Repository\Subscription\SubscriberListRepository;
1010
use PhpList\RestBundle\Entity\Request\CreateSubscriberListRequest;
1111
use PhpList\RestBundle\Service\Manager\SubscriberListManager;
12+
use PHPUnit\Framework\MockObject\MockObject;
1213
use PHPUnit\Framework\TestCase;
1314

1415
class SubscriberListManagerTest extends TestCase
1516
{
16-
private SubscriberListRepository $subscriberListRepository;
17+
private SubscriberListRepository&MockObject $subscriberListRepository;
1718
private SubscriberListManager $manager;
1819

1920
protected function setUp(): void

tests/Unit/Service/Manager/SubscriptionManagerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
use PhpList\Core\Domain\Repository\Subscription\SubscriptionRepository;
1212
use PhpList\RestBundle\Exception\SubscriptionCreationException;
1313
use PhpList\RestBundle\Service\Manager\SubscriptionManager;
14+
use PHPUnit\Framework\MockObject\MockObject;
1415
use PHPUnit\Framework\TestCase;
1516

1617
class SubscriptionManagerTest extends TestCase
1718
{
18-
private SubscriptionRepository $subscriptionRepository;
19-
private SubscriberRepository $subscriberRepository;
19+
private SubscriptionRepository&MockObject $subscriptionRepository;
20+
private SubscriberRepository&MockObject $subscriberRepository;
2021
private SubscriptionManager $manager;
2122

2223
protected function setUp(): void
@@ -83,7 +84,7 @@ public function testDeleteSubscriptionSkipsNotFound(): void
8384

8485
$this->manager->deleteSubscriptions($subscriberList, [$email]);
8586

86-
$this->addToAssertionCount(1); // if no exception thrown, test is OK
87+
$this->addToAssertionCount(1);
8788
}
8889

8990
public function testGetSubscriberListMembersReturnsList(): void

tests/Unit/Validator/EmailExistsValidatorTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PhpList\Core\Domain\Repository\Subscription\SubscriberRepository;
99
use PhpList\RestBundle\Validator\EmailExists;
1010
use PhpList\RestBundle\Validator\EmailExistsValidator;
11+
use PHPUnit\Framework\MockObject\MockObject;
1112
use PHPUnit\Framework\TestCase;
1213
use Symfony\Component\Validator\Constraint;
1314
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -17,7 +18,7 @@
1718

1819
class EmailExistsValidatorTest extends TestCase
1920
{
20-
private SubscriberRepository $subscriberRepository;
21+
private SubscriberRepository&MockObject $subscriberRepository;
2122
private EmailExistsValidator $validator;
2223

2324
protected function setUp(): void
@@ -33,7 +34,7 @@ public function testValidateSkipsNull(): void
3334
{
3435
$this->subscriberRepository->expects($this->never())->method('findOneBy');
3536
$this->validator->validate(null, new EmailExists());
36-
$this->assertTrue(true); // to mark test as passed
37+
$this->assertTrue(true);
3738
}
3839

3940
public function testValidateSkipsEmptyString(): void

tests/Unit/Validator/TemplateExistsValidatorTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PhpList\Core\Domain\Repository\Messaging\TemplateRepository;
99
use PhpList\RestBundle\Validator\TemplateExists;
1010
use PhpList\RestBundle\Validator\TemplateExistsValidator;
11+
use PHPUnit\Framework\MockObject\MockObject;
1112
use PHPUnit\Framework\TestCase;
1213
use Symfony\Component\Validator\Constraint;
1314
use Symfony\Component\Validator\Context\ExecutionContextInterface;
@@ -17,7 +18,7 @@
1718

1819
class TemplateExistsValidatorTest extends TestCase
1920
{
20-
private TemplateRepository $templateRepository;
21+
private TemplateRepository&MockObject $templateRepository;
2122
private TemplateExistsValidator $validator;
2223

2324
protected function setUp(): void

0 commit comments

Comments
 (0)