/** * @test */ public function it_can_get() { $httpClient = new RecordingHttpClient(); $client = new HalClient('http://propilex.herokuapp.com/documents', $httpClient); $link = new HalLink($client, '/documents{?page,limit}', true, 'application/hal+json', 'http://example.com/deprecation', 'name', 'http://example.com/profile', 'title', 'en'); $link->get($this->variables, ['headers' => ['Foo' => 'bar'], 'body' => 'Body', 'query' => 'key1=key2']); $lastRequest = $httpClient->getLastRequest(); $this->assertSame('GET', $lastRequest->getMethod()); $this->assertSame('http://propilex.herokuapp.com/documents?page=1&limit=10&key1=key2', (string) $lastRequest->getUri()); $this->assertSame('Body', (string) $lastRequest->getBody()); $this->assertSame(['bar'], $lastRequest->getHeader('Foo')); }