Exemplo n.º 1
0
 /**
  * @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]);
 }
Exemplo n.º 2
0
 /**
  * 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']);
 }
Exemplo n.º 3
0
 /**
  * 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']);
 }
Exemplo n.º 4
0
 /**
  * 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']);
 }
Exemplo n.º 5
0
 /**
  * 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']);
 }
Exemplo n.º 6
0
 /**
  * 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([]);
 }
Exemplo n.º 7
0
 /**
  * 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']);
 }
Exemplo n.º 8
0
 /**
  * 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']);
 }
Exemplo n.º 9
0
 /**
  * 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']);
 }
Exemplo n.º 10
0
 /**
  * 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']);
 }
Exemplo n.º 11
0
 /**
  * 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']);
 }