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 2121use PHPUnit \Framework \TestCase ;
2222use Psr \Log \LoggerInterface ;
2323use 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 ' );
You can’t perform that action at this time.
0 commit comments