/** * @param array $pOptions * * @return \GuzzleHttp\Client */ protected function CreateHttpClient($pOptions = array()) { /** * My gut says there must be a much better way of doing this, if you run across a * better way, please issue a pull request or drop me a message. @oakensoul */ $mockAdapter = new MockAdapter(function (TransactionInterface $trans) { return ResponseFactory::GetResponse($trans); }); return parent::CreateHttpClient(['adapter' => $mockAdapter]); }
/** * Given: An invalid developer API key * When: API is queried for 2013REG, Week 17 BoxScores * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->BoxScores(['Season' => '2013REG', 'Week' => '17']); }
/** * Given: An invalid developer API key * When: API is queried for PlayerGameStatsByTeamTest, Season 2013REG, Week 17, Team NE * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->PlayerGameStatsByTeam(['Season' => '2013REG', 'Week' => '17', 'Team' => 'NE']); }
/** * Given: An invalid developer API key * When: API is queried for Rob Gronkowski (PlayerID: 10974) * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testPlayerGronkInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->Player(['PlayerID' => '10974']); }
/** * Given: An invalid developer API key * When: API is queried for SeasonLeagueLeaders, Season 2013REG, Position WR, Column FantasyPoints * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->SeasonLeagueLeaders(['Season' => '2013REG', 'Position' => 'WR', 'Column' => 'FantasyPoints']); }
/** * Given: An invalid developer API key * When: API is queried for LiveBoxScores * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->LiveBoxScores([]); }
/** * Given: An invalid developer API key * When: API is queried for AreAnyGamesInProgress * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->Timeframes(['Type' => 'current']); }
/** * Given: An invalid developer API key * When: API is queried for 2014 Teams * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function test2014TeamsInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->Teams(['Season' => '2014']); }
/** * Given: An invalid developer API key * When: API is queried for NewsByTeam * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->NewsByTeam(['Team' => 'NE']); }
/** * Given: An invalid developer API key * When: API is queried for FantasyDefenseBySeason, Season 2013REG * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->FantasyDefenseBySeason(['Season' => '2013REG']); }
/** * Given: An invalid developer API key * When: API is queried for PlayerSeasonStatsByPlayerID, Season 2013REG, Team NE * Then: Expect a 401 response in the form of a Guzzle CommandClientException * * @group Integration * @small * * @expectedException \GuzzleHttp\Command\Exception\CommandClientException */ public function testInvalidAPIKey() { $client = new DebugClient('invalid_api_key', Subscription::KEY_DEVELOPER); /** @var \GuzzleHttp\Command\Model $result */ $client->PlayerSeasonStatsByPlayerID(['Season' => '2013REG', 'PlayerID' => '10974']); }