Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix phpunit warning
Method getResponse may not return value of type Mock_IResponse_c6b56317, its return declaration is ": Psr\Http\Message\ResponseInterface"

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Mar 26, 2021
commit 68dfa3f88d6086dae1f199a336b0fae260f9fc92
13 changes: 7 additions & 6 deletions tests/Unit/PushTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
use OCP\Notification\INotification;
use OCP\UserStatus\IManager as IUserStatusManager;
use PHPUnit\Framework\MockObject\MockObject;
use Psr\Http\Message\ResponseInterface;

/**
* Class PushTest
Expand Down Expand Up @@ -519,8 +520,8 @@ public function testPushToDeviceSending($isDebug) {
'level' => ILogger::ERROR,
]);

/** @var IResponse|MockObject $response1 */
$response1 = $this->createMock(IResponse::class);
/** @var ResponseInterface|MockObject $response1 */
$response1 = $this->createMock(ResponseInterface::class);
$response1->expects($this->once())
->method('getStatusCode')
->willReturn(Http::STATUS_BAD_REQUEST);
Expand All @@ -547,8 +548,8 @@ public function testPushToDeviceSending($isDebug) {
'app' => 'notifications',
]);

/** @var IResponse|MockObject $response1 */
$response2 = $this->createMock(IResponse::class);
/** @var ResponseInterface|MockObject $response1 */
$response2 = $this->createMock(ResponseInterface::class);
$response2->expects($this->once())
->method('getBody')
->willReturn('Maintenance');
Expand Down Expand Up @@ -586,8 +587,8 @@ public function testPushToDeviceSending($isDebug) {
])
->willReturn($response3);

/** @var IResponse|MockObject $response1 */
$response4 = $this->createMock(IResponse::class);
/** @var ResponseInterface|MockObject $response1 */
$response4 = $this->createMock(ResponseInterface::class);
$response4->expects($this->once())
->method('getStatusCode')
->willReturn(Http::STATUS_BAD_REQUEST);
Expand Down