/** * @param array $pOptions * * @return \GuzzleHttp\Client */ protected function CreateHttpClient($pOptions = []) { $client = parent::CreateHttpClient($pOptions); $this->mHistory = new History(); $client->getEmitter()->attach($this->mHistory); return $client; }
/** * Given a valid API key * When a new FantasyDataAPI Service is created * Then a FantasyDataAPI client is returned with the proper Service Description and Base URL Host */ public function testClientServiceDescriptionBaseUrlValue() { $client = new FantasyDataAPI\Client('000aaaa0-a00a-0000-0a0a-aa0a00000000'); $base = $client->getDescription()->getBaseUrl(); $uri = $client->getDescription()->getData('baseUrl'); $host = $base->getHost(); $this->assertInstanceOf('GuzzleHttp\\Url', $base); $this->assertEquals('api.nfldata.apiphany.com', $host); $this->assertEquals('http://api.nfldata.apiphany.com/{Subscription}/{Format}/', $uri); }