public function setUp()
 {
     $config = (include __DIR__ . '/config.php');
     $access_token_data = new AccessTokenData();
     $access_token_data->setLongAccessToken($config['long_access_token'], 3600);
     $core = new \ebussola\facebook\core\Core($config['app_id'], $config['secret'], $config['redirect_uri'], $access_token_data);
     $this->ads = new \ebussola\facebook\ads\Ads($core);
     $this->facebook = new \ebussola\ads\reports\facebook\Facebook($this->ads, $config['account_id']);
 }
Exemplo n.º 2
0
 public function testExpiredToken()
 {
     global $config;
     $token = (include __DIR__ . '/long_access_token.php');
     $access_token_data = new AccessTokenData();
     $access_token_data->setLongAccessToken($token['access_token'], 1);
     $core = new \ebussola\facebook\core\Core($config['app_id'], $config['secret'], $config['redirect_uri'], $access_token_data);
     sleep(2);
     $this->assertFalse($core->isLogged());
 }
Exemplo n.º 3
0
 public function setUp()
 {
     $config = (include 'config.php');
     $access_token_data = new AccessTokenData();
     $access_token_data->setLongAccessToken($config['long_access_token'], 5000);
     $core = new \ebussola\facebook\core\Core($config['app_id'], $config['secret'], $config['redirect_uri'], $access_token_data);
     // instantiating the wrong way to clear the memory
     $pools = array('account' => new \ebussola\facebook\ads\pool\AccountPool(), 'ad_campaign' => new \ebussola\facebook\ads\pool\AdCampaignPool(), 'adset' => new \ebussola\facebook\ads\pool\AdSetPool(), 'adgroup' => new \ebussola\facebook\ads\pool\AdGroupPool(), 'creative' => new \ebussola\facebook\ads\pool\CreativePool());
     $this->ads = new \ebussola\facebook\ads\Ads($core, $pools);
 }
Exemplo n.º 4
0
 public function testOAuthException()
 {
     $this->setExpectedException('\\ebussola\\facebook\\core\\exception\\OAuthException');
     global $config;
     $app_id = $config['app_id'];
     $secret = $config['secret'];
     $redirect_uri = $config['redirect_uri'];
     $access_token_data = new AccessTokenData();
     $access_token_data->setLongAccessToken('foo', 5000);
     $this->core = new \ebussola\facebook\core\Core($app_id, $secret, $redirect_uri, $access_token_data);
     // any request, just to get the error
     $this->core->curl(array(), '/me', 'get');
 }