Skip to content

Commit ea00720

Browse files
committed
Add return type assertion
1 parent 10363f5 commit ea00720

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ResetAttemptForBackendObserverTest extends TestCase
2828
public function testExecuteExpectsDeleteUserAttemptsCalled()
2929
{
3030
$logMock = $this->createMock(Log::class);
31-
$logMock->expects($this->once())->method('deleteUserAttempts');
31+
$logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf();
3232

3333
$resLogFactoryMock = $this->createMock(LogFactory::class);
3434
$resLogFactoryMock->expects($this->once())
@@ -48,6 +48,6 @@ public function testExecuteExpectsDeleteUserAttemptsCalled()
4848
ResetAttemptForBackendObserver::class,
4949
['resLogFactory' => $resLogFactoryMock]
5050
);
51-
$observer->execute($eventObserverMock);
51+
$this->assertInstanceOf(Log::class, $observer->execute($eventObserverMock));
5252
}
5353
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ResetAttemptForFrontendObserverTest extends TestCase
2828
public function testExecuteExpectsDeleteUserAttemptsCalled()
2929
{
3030
$logMock = $this->createMock(Log::class);
31-
$logMock->expects($this->once())->method('deleteUserAttempts');
31+
$logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf();
3232

3333
$resLogFactoryMock = $this->createMock(LogFactory::class);
3434
$resLogFactoryMock->expects($this->once())
@@ -47,6 +47,6 @@ public function testExecuteExpectsDeleteUserAttemptsCalled()
4747
ResetAttemptForFrontendObserver::class,
4848
['resLogFactory' => $resLogFactoryMock]
4949
);
50-
$observer->execute($eventObserverMock);
50+
$this->assertInstanceOf(Log::class, $observer->execute($eventObserverMock));
5151
}
5252
}

0 commit comments

Comments
 (0)