Definition at line 45 of file HTTPServicesTest.php.
◆ setUp()
ILIAS\DI\HTTPServicesTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 70 of file HTTPServicesTest.php.
73 $this->mockRequestFactory = $this->getMockBuilder(RequestFactory::class)->getMock();
75 $this->mockResponseFactory = $this->getMockBuilder(ResponseFactory::class)->getMock();
77 $this->mockSenderStrategy = $this->getMockBuilder(ResponseSenderStrategy::class)->getMock();
79 $this->mockCookieJarFactory = $this->getMockBuilder(CookieJarFactory::class)->getMock();
81 $this->mockDurationFactory = $this->createMock(DurationFactory::class);
83 $this->httpState =
new RawHTTPServices($this->mockSenderStrategy, $this->mockCookieJarFactory, $this->mockRequestFactory, $this->mockResponseFactory, $this->mockDurationFactory);
◆ testRequestWhichShouldGenerateANewRequestOnce()
ILIAS\DI\HTTPServicesTest::testRequestWhichShouldGenerateANewRequestOnce |
( |
| ) |
|
Definition at line 88 of file HTTPServicesTest.php.
90 $expectedRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
91 $wrongRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
93 $this->mockRequestFactory->expects($this->once())
95 ->willReturn($expectedRequest, $wrongRequest);
100 $request1 = $this->httpState->request();
103 $request2 = $this->httpState->request();
106 $this->assertEquals($expectedRequest, $request1);
107 $this->assertEquals($expectedRequest, $request2);
◆ testResponseWhichShouldGenerateANewResponseOnce()
ILIAS\DI\HTTPServicesTest::testResponseWhichShouldGenerateANewResponseOnce |
( |
| ) |
|
Definition at line 112 of file HTTPServicesTest.php.
114 $expectedResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
115 $wrongResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
117 $this->mockResponseFactory->expects($this->once())
119 ->willReturn($expectedResponse, $wrongResponse);
124 $response1 = $this->httpState->response();
127 $response2 = $this->httpState->response();
130 $this->assertEquals($expectedResponse, $response1);
131 $this->assertEquals($expectedResponse, $response2);
◆ $httpState
GlobalHttpState ILIAS\DI\HTTPServicesTest::$httpState |
|
private |
◆ $mockCookieJarFactory
CookieJarFactory MockObject ILIAS\DI\HTTPServicesTest::$mockCookieJarFactory |
|
private |
◆ $mockDurationFactory
DurationFactory ILIAS\DI\HTTPServicesTest::$mockDurationFactory |
|
private |
◆ $mockRequestFactory
RequestFactory MockObject ILIAS\DI\HTTPServicesTest::$mockRequestFactory |
|
private |
◆ $mockResponseFactory
ResponseFactory MockObject ILIAS\DI\HTTPServicesTest::$mockResponseFactory |
|
private |
◆ $mockSenderStrategy
DurationFactory MockObject ILIAS\DI\HTTPServicesTest::$mockSenderStrategy |
|
private |
The documentation for this class was generated from the following file: