Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function testExternalRequests() { |
||
33 | |||
34 | $client = $this->prophesize(ClientInterface::class); |
||
35 | $client->request('GET', 'http://drupal.graphql')->willReturn(new Response( |
||
36 | 200, |
||
37 | ['graphql' => 'test'], |
||
38 | '<p>GraphQL is awesome!</p>' |
||
39 | )); |
||
40 | |||
41 | $this->container->set('http_client', $client->reveal()); |
||
42 | |||
43 | // TODO: Check cache metadata. |
||
44 | // Add cache information from external response? |
||
45 | $metadata = $this->defaultCacheMetaData(); |
||
46 | |||
47 | $this->assertResults($this->getQueryFromFile('external_requests.gql'), [], [ |
||
48 | 'route' => [ |
||
49 | 'request' => [ |
||
50 | 'code' => 200, |
||
51 | 'content' => '<p>GraphQL is awesome!</p>', |
||
52 | 'header' => 'test', |
||
53 | ], |
||
54 | ], |
||
55 | ], $metadata); |
||
56 | } |
||
57 | |||
59 |