File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
app/code/Magento/Customer/Test/Unit/Model/Plugin Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 21
21
use PHPUnit \Framework \TestCase ;
22
22
use Psr \Log \LoggerInterface ;
23
23
use Magento \Framework \Session \StorageInterface ;
24
+ use Magento \Framework \App \Request \Http as RequestHttp ;
24
25
25
26
/**
26
27
* Unit test for CustomerNotification plugin
@@ -83,9 +84,7 @@ protected function setUp(): void
83
84
84
85
$ this ->customerRepositoryMock = $ this ->getMockForAbstractClass (CustomerRepositoryInterface::class);
85
86
$ 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);
89
88
$ this ->requestMock ->method ('isPost ' )->willReturn (true );
90
89
91
90
$ this ->loggerMock = $ this ->getMockForAbstractClass (LoggerInterface::class);
@@ -157,7 +156,9 @@ public function testBeforeDispatchWithNoCustomerFound()
157
156
158
157
public function testBeforeExecuteForLogoutRequest ()
159
158
{
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 ' );
161
162
162
163
$ this ->sessionMock ->expects ($ this ->never ())->method ('regenerateId ' );
163
164
$ this ->sessionMock ->expects ($ this ->never ())->method ('setCustomerData ' );
You can’t perform that action at this time.
0 commit comments