Skip to content

Commit 93f0eb7

Browse files
author
Anna Bukatar
committed
ACP2E-2259: Dynamic Blocks based on Customer Segments don't work correctly (Double Banner after Sign Out when using Segment)
1 parent 07f7b61 commit 93f0eb7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerNotificationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use PHPUnit\Framework\TestCase;
2222
use Psr\Log\LoggerInterface;
2323
use Magento\Framework\Session\StorageInterface;
24+
use Magento\Framework\App\Request\Http as RequestHttp;
2425

2526
/**
2627
* Unit test for CustomerNotification plugin
@@ -83,9 +84,7 @@ protected function setUp(): void
8384

8485
$this->customerRepositoryMock = $this->getMockForAbstractClass(CustomerRepositoryInterface::class);
8586
$this->actionMock = $this->getMockForAbstractClass(ActionInterface::class);
86-
$this->requestMock = $this->getMockBuilder(RequestStubInterface::class)
87-
->addMethods(['getRequestUri'])
88-
->getMockForAbstractClass();
87+
$this->requestMock = $this->createMock(RequestHttp::class);
8988
$this->requestMock->method('isPost')->willReturn(true);
9089

9190
$this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class);
@@ -157,7 +156,9 @@ public function testBeforeDispatchWithNoCustomerFound()
157156

158157
public function testBeforeExecuteForLogoutRequest()
159158
{
160-
$this->requestMock->method('getRequestUri')->willReturn('/customer/account/logout/');
159+
$this->requestMock->method('getRouteName')->willReturn('customer');
160+
$this->requestMock->method('getControllerName')->willReturn('account');
161+
$this->requestMock->method('getActionName')->willReturn('logout');
161162

162163
$this->sessionMock->expects($this->never())->method('regenerateId');
163164
$this->sessionMock->expects($this->never())->method('setCustomerData');

0 commit comments

Comments
 (0)