Definition at line 30 of file HTTPServicesTest.php.
◆ setUp()
ILIAS\DI\HTTPServicesTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 55 of file HTTPServicesTest.php.
58 $this->mockRequestFactory = \Mockery::mock(RequestFactory::class);
59 $this->mockResponseFactory = \Mockery::mock(ResponseFactory::class);
60 $this->mockSenderStrategy = \Mockery::mock(ResponseSenderStrategy::class);
61 $this->mockCookieJarFactory = \Mockery::mock(CookieJarFactory::class);
64 $this->httpState =
new HTTPServices($this->mockSenderStrategy, $this->mockCookieJarFactory, $this->mockRequestFactory, $this->mockResponseFactory);
◆ testRequestWhichShouldGenerateANewRequestOnce()
ILIAS\DI\HTTPServicesTest::testRequestWhichShouldGenerateANewRequestOnce |
( |
| ) |
|
Definition at line 71 of file HTTPServicesTest.php.
73 $expectedRequest = \Mockery::mock(RequestInterface::class);
74 $wrongRequest = \Mockery::mock(RequestInterface::class);
76 $this->mockRequestFactory->shouldReceive(
"create")->withNoArgs()->once()->andReturnValues([ $expectedRequest, $wrongRequest ]);
81 $request1 = $this->httpState->request();
84 $request2 = $this->httpState->request();
87 $this->assertEquals($expectedRequest, $request1);
88 $this->assertEquals($expectedRequest, $request2);
◆ testResponseWhichShouldGenerateANewResponseOnce()
ILIAS\DI\HTTPServicesTest::testResponseWhichShouldGenerateANewResponseOnce |
( |
| ) |
|
Definition at line 95 of file HTTPServicesTest.php.
97 $expectedResponse = \Mockery::mock(ResponseInterface::class);
98 $wrongResponse = \Mockery::mock(ResponseInterface::class);
100 $this->mockResponseFactory->shouldReceive(
"create")->withNoArgs()->once()->andReturnValues([ $expectedResponse, $wrongResponse ]);
105 $response1 = $this->httpState->response();
108 $response2 = $this->httpState->response();
111 $this->assertEquals($expectedResponse, $response1);
112 $this->assertEquals($expectedResponse, $response2);
◆ $httpState
◆ $mockCookieJarFactory
◆ $mockRequestFactory
RequestFactory MockInterface ILIAS\DI\HTTPServicesTest::$mockRequestFactory |
|
private |
◆ $mockResponseFactory
ResponseFactory MockInterface ILIAS\DI\HTTPServicesTest::$mockResponseFactory |
|
private |
◆ $mockSenderStrategy
The documentation for this class was generated from the following file: