Definition at line 30 of file HTTPServicesTest.php.
◆ setUp()
ILIAS\DI\HTTPServicesTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 55 of file HTTPServicesTest.php.
59 $this->mockRequestFactory = $this->getMockBuilder(RequestFactory::class)->setMethods([
'create'])->getMock();
62 $this->mockResponseFactory = $this->getMockBuilder(ResponseFactory::class)->setMethods([
'create'])->getMock();
65 $this->mockSenderStrategy = $this->getMockBuilder(ResponseSenderStrategy::class)->getMock();
68 $this->mockCookieJarFactory = $this->getMockBuilder(CookieJarFactory::class)->getMock();
71 $this->httpState =
new HTTPServices($this->mockSenderStrategy, $this->mockCookieJarFactory, $this->mockRequestFactory, $this->mockResponseFactory);
◆ testRequestWhichShouldGenerateANewRequestOnce()
ILIAS\DI\HTTPServicesTest::testRequestWhichShouldGenerateANewRequestOnce |
( |
| ) |
|
Definition at line 78 of file HTTPServicesTest.php.
80 $expectedRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
81 $wrongRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
83 $this->mockRequestFactory->expects($this->once())
85 ->willReturn($expectedRequest, $wrongRequest);
90 $request1 = $this->httpState->request();
93 $request2 = $this->httpState->request();
96 $this->assertEquals($expectedRequest, $request1);
97 $this->assertEquals($expectedRequest, $request2);
◆ testResponseWhichShouldGenerateANewResponseOnce()
ILIAS\DI\HTTPServicesTest::testResponseWhichShouldGenerateANewResponseOnce |
( |
| ) |
|
Definition at line 104 of file HTTPServicesTest.php.
106 $expectedResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
107 $wrongResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
109 $this->mockResponseFactory->expects($this->once())
111 ->willReturn($expectedResponse, $wrongResponse);
116 $response1 = $this->httpState->response();
119 $response2 = $this->httpState->response();
122 $this->assertEquals($expectedResponse, $response1);
123 $this->assertEquals($expectedResponse, $response2);
◆ $httpState
◆ $mockCookieJarFactory
◆ $mockRequestFactory
RequestFactory MockObject ILIAS\DI\HTTPServicesTest::$mockRequestFactory |
|
private |
◆ $mockResponseFactory
◆ $mockSenderStrategy
The documentation for this class was generated from the following file: