private function getConfigMock($json) { $restClient = Mockery::mock("chegamos\\rest\\client\\Guzzle"); $restClient->shouldReceive('execute')->once()->andReturn($json); $config = new Config(); $config->setBaseUrl('http://api.apontador.com.br/v1/'); $config->setBasicAuth(new BasicAuth("User", "Pass")); $config->setRestClient($restClient); return $config; }
public function __construct(array $config = array()) { $this->api = new ApontadorApi(); $apiConfig = new Config(); $apiConfig->setBaseUrl(APONTADOR_URL); $apiConfig->setBasicAuth(new BasicAuth(APONTADOR_CONSUMER_KEY, APONTADOR_CONSUMER_SECRET)); $apiConfig->setRestClient(new RestClient()); $this->userRepository = new UserRepository($apiConfig); parent::__construct($config); }
private function getPlaceRepo() { $restClient = new Guzzle(); $config = new Config(); $config->setBaseUrl('http://api.apontador.com.br/v1/'); $config->setBasicAuth(new BasicAuth("User", "Pass")); $config->setRestClient($restClient); return new PlaceRepository($config); }