dummyGetResponsePlugin = new DummyGetResponsePlugin(); } public function testInitialize(): void { /** @var Server $server */ $server = $this->getMockBuilder(Server::class) ->disableOriginalConstructor() ->getMock(); $server ->expects($this->once()) ->method('on') ->with('method:GET', [$this->dummyGetResponsePlugin, 'httpGet'], 200); $this->dummyGetResponsePlugin->initialize($server); } public function testHttpGet(): void { /** @var \Sabre\HTTP\RequestInterface $request */ $request = $this->getMockBuilder(RequestInterface::class) ->disableOriginalConstructor() ->getMock(); /** @var \Sabre\HTTP\ResponseInterface $response */ $response = $server = $this->getMockBuilder(ResponseInterface::class) ->disableOriginalConstructor() ->getMock(); $response ->expects($this->once()) ->method('setBody'); $response ->expects($this->once()) ->method('setStatus') ->with(200); $this->assertSame(false, $this->dummyGetResponsePlugin->httpGet($request, $response)); } }