Skip to content

Commit ffa0aa3

Browse files
committed
remove extra code
1 parent 428f65f commit ffa0aa3

2 files changed

Lines changed: 0 additions & 43 deletions

File tree

src/Domain/Subscription/Service/Manager/SubscribePageManager.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
use PhpList\Core\Domain\Subscription\Model\SubscribePageData;
1111
use PhpList\Core\Domain\Subscription\Repository\SubscriberPageDataRepository;
1212
use PhpList\Core\Domain\Subscription\Repository\SubscriberPageRepository;
13-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
14-
use Symfony\Contracts\Translation\TranslatorInterface;
1513

1614
class SubscribePageManager
1715
{
1816
public function __construct(
1917
private readonly SubscriberPageRepository $pageRepository,
2018
private readonly SubscriberPageDataRepository $pageDataRepository,
2119
private readonly EntityManagerInterface $entityManager,
22-
private readonly TranslatorInterface $translator,
2320
) {
2421
}
2522

@@ -35,17 +32,6 @@ public function createPage(string $title, bool $active = false, ?Administrator $
3532
return $page;
3633
}
3734

38-
public function getPage(int $id): SubscribePage
39-
{
40-
/** @var SubscribePage|null $page */
41-
$page = $this->pageRepository->find($id);
42-
if (!$page) {
43-
throw new NotFoundHttpException($this->translator->trans('Subscribe page not found'));
44-
}
45-
46-
return $page;
47-
}
48-
4935
public function updatePage(
5036
SubscribePage $page,
5137
?string $title = null,

tests/Unit/Domain/Subscription/Service/Manager/SubscribePageManagerTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use PhpList\Core\Domain\Subscription\Service\Manager\SubscribePageManager;
1414
use PHPUnit\Framework\MockObject\MockObject;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1716
use Symfony\Component\Translation\Translator;
1817

1918
class SubscribePageManagerTest extends TestCase
@@ -53,34 +52,6 @@ public function testCreatePageCreatesAndSaves(): void
5352
$this->assertSame($owner, $page->getOwner());
5453
}
5554

56-
public function testGetPageReturnsPage(): void
57-
{
58-
$page = new SubscribePage();
59-
$this->pageRepository
60-
->expects($this->once())
61-
->method('find')
62-
->with(123)
63-
->willReturn($page);
64-
65-
$result = $this->manager->getPage(123);
66-
67-
$this->assertSame($page, $result);
68-
}
69-
70-
public function testGetPageThrowsWhenNotFound(): void
71-
{
72-
$this->pageRepository
73-
->expects($this->once())
74-
->method('find')
75-
->with(999)
76-
->willReturn(null);
77-
78-
$this->expectException(NotFoundHttpException::class);
79-
$this->expectExceptionMessage('Subscribe page not found');
80-
81-
$this->manager->getPage(999);
82-
}
83-
8455
public function testUpdatePageUpdatesProvidedFieldsAndFlushes(): void
8556
{
8657
$originalOwner = new Administrator();

0 commit comments

Comments
 (0)