cameraPictureManager = $this->prophesize(CameraPictureManagerService::class); $this->cameraPictureManager->getCameraImage(self::CAM_DIR, self::IMG_FILE) ->willReturn($this->prophesize(JsonResponse::class)); } public function testReturnsJsonResponse() { $homePage = new ShowCameraImageAction( $this->cameraPictureManager->reveal() ); $request = $this->prophesize(ServerRequestInterface::class); $request->getAttribute('camera') ->willReturn('cam1'); $request->getAttribute('image') ->willReturn('img1.png'); $response = $homePage->process( $request->reveal(), $this->prophesize(DelegateInterface::class)->reveal() ); $this->assertInstanceOf(JsonResponse::class, $response); } }