/** * @param array $config * * @return Container */ public static function create(array $config) { $container = new self($config); $container['onesky_client'] = $container->factory(function ($container) { $client = new Client(); $client->setApiKey($container['onesky_api_key']); $client->setSecret($container['onesky_api_secret']); return $client; }); return $container; }
/** * @param string $source * @param string $locale * * @return mixed */ private function fetch($source, $locale) { $content = $this->client->translations('export', array('project_id' => $this->project, 'locale' => $locale, 'source_file_name' => $source)); return $content; }
/** * @expectedException \UnexpectedValueException * @expectedExceptionMessage Invalid authenticate data of api key or secret */ public function testTranslationsStatusDetectInvalidAuthentication() { $this->api->translations('status', ['project_id' => 123]); }
/** * @expectedException \UnexpectedValueException * @expectedExceptionMessage Invalid authenticate data of api key or secret */ public function testFilesDeleteDetectInvalidAuthentication() { $this->api->files('delete', ['project_id' => 123]); }
/** * @expectedException \UnexpectedValueException * @expectedExceptionMessage Invalid authenticate data of api key or secret */ public function testProjectsLanguagesDetectInvalidAuthentication() { $this->api->projects('languages', ['project_id' => 123]); }