Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testCreatesRequest(): void |
||
14 | { |
||
15 | $_ENV['BASE_URI'] = 'http://localhost'; |
||
16 | |||
17 | $request = (new RequestFactory())->create(Request::METHOD_POST, '/resources', [ |
||
18 | RequestFactory::REQUEST_JSON => ['foo' => 'bar'] |
||
19 | ]); |
||
20 | |||
21 | $this->assertSame(json_encode(['foo' => 'bar']), $request->getContent()); |
||
22 | $this->assertSame(Request::METHOD_POST, $request->getMethod()); |
||
23 | $this->assertSame('http://localhost/resources', $request->getUri()); |
||
24 | $this->assertSame('application/json', $request->headers->get('Accept')); |
||
25 | $this->assertSame('application/json', $request->headers->get('Content-Type')); |
||
26 | } |
||
28 |