Definition at line 30 of file HTTPServicesTest.php.
◆ setUp()
ILIAS\DI\HTTPServicesTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 55 of file HTTPServicesTest.php.
56 {
57 parent::setUp();
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);
62
63
64 $this->httpState = new HTTPServices($this->mockSenderStrategy, $this->mockCookieJarFactory, $this->mockRequestFactory, $this->mockResponseFactory);
65 }
◆ testRequestWhichShouldGenerateANewRequestOnce()
ILIAS\DI\HTTPServicesTest::testRequestWhichShouldGenerateANewRequestOnce |
( |
| ) |
|
@Test
Definition at line 71 of file HTTPServicesTest.php.
72 {
73 $expectedRequest = \Mockery::mock(RequestInterface::class);
74 $wrongRequest = \Mockery::mock(RequestInterface::class);
75
76 $this->mockRequestFactory->shouldReceive("create")->withNoArgs()->once()->andReturnValues([ $expectedRequest, $wrongRequest ]);
77
78
79
80
81 $request1 = $this->httpState->request();
82
83
84 $request2 = $this->httpState->request();
85
86
87 $this->assertEquals($expectedRequest, $request1);
88 $this->assertEquals($expectedRequest, $request2);
89 }
◆ testResponseWhichShouldGenerateANewResponseOnce()
ILIAS\DI\HTTPServicesTest::testResponseWhichShouldGenerateANewResponseOnce |
( |
| ) |
|
@Test
Definition at line 95 of file HTTPServicesTest.php.
96 {
97 $expectedResponse = \Mockery::mock(ResponseInterface::class);
98 $wrongResponse = \Mockery::mock(ResponseInterface::class);
99
100 $this->mockResponseFactory->shouldReceive("create")->withNoArgs()->once()->andReturnValues([ $expectedResponse, $wrongResponse ]);
101
102
103
104
105 $response1 = $this->httpState->response();
106
107
108 $response2 = $this->httpState->response();
109
110
111 $this->assertEquals($expectedResponse, $response1);
112 $this->assertEquals($expectedResponse, $response2);
113 }
◆ $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: