-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EPC-9177] Refactor the overview page title
- Loading branch information
Can Demiralp
committed
Feb 14, 2025
1 parent
5103a62
commit 2ae0815
Showing
2 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Test/Unit/Controller/Adminhtml/Notification/OverviewTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* | ||
* Adyen Payment module (https://www.adyen.com/) | ||
* | ||
* Copyright (c) 2025 Adyen N.V. (https://www.adyen.com/) | ||
* See LICENSE.txt for license details. | ||
* | ||
* Author: Adyen <magento@adyen.com> | ||
*/ | ||
|
||
namespace Adyen\Payment\Test\Unit\Controller\Adminhtml\Notification; | ||
|
||
use Adyen\Payment\Controller\Adminhtml\Notifications\Overview; | ||
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase; | ||
use Magento\Backend\Model\View\Result\Page; | ||
use Magento\Backend\App\Action\Context; | ||
use Magento\Framework\Controller\ResultFactory; | ||
use Magento\Framework\View\Page\Config; | ||
use Magento\Framework\View\Page\Title; | ||
|
||
class OverviewTest extends AbstractAdyenTestCase | ||
{ | ||
/** | ||
* @return void | ||
*/ | ||
public function testExecute() | ||
{ | ||
$titleMock = $this->createMock(Title::class); | ||
$titleMock->expects($this->once()) | ||
->method('prepend') | ||
->with(__('Adyen Webhooks Overview')); | ||
|
||
$configMock = $this->createMock(Config::class); | ||
$configMock->method('getTitle')->willReturn($titleMock); | ||
|
||
$pageMock = $this->createMock(Page::class); | ||
$pageMock->method('setActiveMenu') | ||
->with('Adyen_Payment::notifications_overview') | ||
->willReturnSelf(); | ||
$pageMock->method('getConfig')->willReturn($configMock); | ||
|
||
$resultFactoryMock = $this->createMock(ResultFactory::class); | ||
$resultFactoryMock->expects($this->once()) | ||
->method('create') | ||
->with(ResultFactory::TYPE_PAGE) | ||
->willReturn($pageMock); | ||
|
||
$contextMock = $this->createMock(Context::class); | ||
$contextMock->method('getResultFactory')->willReturn($resultFactoryMock); | ||
|
||
$overview = new Overview($contextMock); | ||
|
||
$result = $overview->execute(); | ||
$this->assertInstanceOf(Page::class, $result); | ||
} | ||
} |