Skip to content

Commit 472e808

Browse files
committed
Adjust Unit Tests to follow Request fetched on Constructor
1 parent 2d2d1d9 commit 472e808

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/code/Magento/Captcha/Test/Unit/Observer/CheckUserForgotPasswordBackendObserverTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ protected function setUp()
101101
->getMockForAbstractClass();
102102
$this->actionFlagMock = $this->createMock(ActionFlag::class);
103103
$this->messageManagerMock = $this->createMock(ManagerInterface::class);
104+
$this->requestMock = $this->createMock(HttpRequest::class);
104105

105106
$objectManager = new ObjectManagerHelper($this);
106107
$this->observer = $objectManager->getObject(
@@ -110,7 +111,8 @@ protected function setUp()
110111
'captchaStringResolver' => $this->captchaStringResolverMock,
111112
'_session' => $this->sessionMock,
112113
'_actionFlag' => $this->actionFlagMock,
113-
'messageManager' => $this->messageManagerMock
114+
'messageManager' => $this->messageManagerMock,
115+
'request' => $this->requestMock
114116
]
115117
);
116118

@@ -122,16 +124,12 @@ protected function setUp()
122124
->with($formId)
123125
->willReturn($this->captchaMock);
124126

125-
$this->requestMock = $this->createMock(HttpRequest::class);
126127
$this->httpResponseMock = $this->createMock(HttpResponse::class);
127128

128129
$this->controllerMock = $this->getMockBuilder(Action::class)
129130
->disableOriginalConstructor()
130-
->setMethods(['getUrl', 'getRequest', 'getResponse'])
131+
->setMethods(['getUrl', 'getResponse'])
131132
->getMockForAbstractClass();
132-
$this->controllerMock->expects($this->any())
133-
->method('getRequest')
134-
->willReturn($this->requestMock);
135133
$this->controllerMock->expects($this->any())
136134
->method('getResponse')
137135
->willReturn($this->httpResponseMock);

0 commit comments

Comments
 (0)