Definition at line 46 of file HTTPServicesTest.php.
◆ setUp()
ILIAS\DI\HTTPServicesTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 71 of file HTTPServicesTest.php.
74 $this->mockRequestFactory = $this->getMockBuilder(RequestFactory::class)->getMock();
76 $this->mockResponseFactory = $this->getMockBuilder(ResponseFactory::class)->getMock();
78 $this->mockSenderStrategy = $this->getMockBuilder(ResponseSenderStrategy::class)->getMock();
80 $this->mockCookieJarFactory = $this->getMockBuilder(CookieJarFactory::class)->getMock();
82 $this->mockDurationFactory = $this->createMock(DurationFactory::class);
84 $this->httpState =
new RawHTTPServices($this->mockSenderStrategy, $this->mockCookieJarFactory, $this->mockRequestFactory, $this->mockResponseFactory, $this->mockDurationFactory);
◆ testRequestWhichShouldGenerateANewRequestOnce()
ILIAS\DI\HTTPServicesTest::testRequestWhichShouldGenerateANewRequestOnce |
( |
| ) |
|
Definition at line 91 of file HTTPServicesTest.php.
93 $expectedRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
94 $wrongRequest = $this->getMockBuilder(ServerRequestInterface::class)->getMock();
96 $this->mockRequestFactory->expects($this->once())
98 ->willReturn($expectedRequest, $wrongRequest);
103 $request1 = $this->httpState->request();
106 $request2 = $this->httpState->request();
109 $this->assertEquals($expectedRequest, $request1);
110 $this->assertEquals($expectedRequest, $request2);
◆ testResponseWhichShouldGenerateANewResponseOnce()
ILIAS\DI\HTTPServicesTest::testResponseWhichShouldGenerateANewResponseOnce |
( |
| ) |
|
Definition at line 117 of file HTTPServicesTest.php.
119 $expectedResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
120 $wrongResponse = $this->getMockBuilder(ResponseInterface::class)->getMock();
122 $this->mockResponseFactory->expects($this->once())
124 ->willReturn($expectedResponse, $wrongResponse);
129 $response1 = $this->httpState->response();
132 $response2 = $this->httpState->response();
135 $this->assertEquals($expectedResponse, $response1);
136 $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: