/** * @test * @vcr stub_comics_request */ public function test_first_setup() { $config = ['base_uri' => env('MARVEL_API_BASE_URL'), 'timeout' => 0, 'allow_redirects' => false, 'verify' => false, 'headers' => ['Content-Type' => 'application/json']]; $guzzle = new \GuzzleHttp\Client($config); $key = env('MARVEL_API_KEY'); $secret = env('MARVEL_API_SECRET'); $client = new MarvelApi($key, $secret, $guzzle); $client->setApiVersion(env('MARVEL_API_VERSION')); $ts = '1459629709'; $results = $client->setTimeStamp($ts)->comics(); $this->assertEquals(200, $results['code']); }
/** * Bootstrap the application services. * * @return void */ public function boot() { $this->app->bind(\Alnutile\UniversalComicClient\ComicClientInterface::class, function () { $config = ['base_uri' => Config::get('marvel.MARVEL_API_BASE_URL'), 'timeout' => 0, 'allow_redirects' => false, 'verify' => false, 'headers' => ['Content-Type' => 'application/json']]; $client = new Client($config); $key = env('MARVEL_API_KEY'); $secret = env('MARVEL_API_SECRET'); $client = new MarvelApi($key, $secret, $client); $client->setApiVersion(Config::get('marvel.MARVEL_API_VERSION')); return $client; }); $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'universal-comic-client'); $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'universal-comic-client'); $this->publishes([__DIR__ . '/../../../src/config/marvel.php' => config_path('marvel.php')], 'config'); }