Inheritance: implements seregazhuk\PinterestBot\Contracts\ProvidersContainerInterface
Esempio n. 1
0
 /**
  * Returns client context from Pinterest response. By default info returns from the last
  * Pinterest response. If there was no response before or the argument $reload is
  * true, we make a dummy request to the main page to update client context.
  *
  * @param bool $reload
  * @return array|null
  */
 public function getClientInfo($reload = false)
 {
     $clientInfo = $this->providersContainer->getClientInfo();
     if (is_null($clientInfo) || $reload) {
         $this->auth->visitMainPage();
     }
     return $this->providersContainer->getClientInfo();
 }
 /**
  * @test
  * @expectedException \seregazhuk\PinterestBot\Exceptions\WrongProviderException
  */
 public function getWrongProvider()
 {
     $this->container->getProvider('unknown');
 }
 /** @test */
 public function it_returns_http_client_instance()
 {
     $this->request->shouldReceive('getHttpClient')->andReturn(new CurlHttpClient(new Cookies()));
     $this->assertInstanceOf(HttpClient::class, $this->container->getHttpClient());
 }