Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 9 |
CRAP | |
0.00% |
0 / 56 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 9 |
156 | |
0.00% |
0 / 56 |
|
__construct($config, $logCallback = null) | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 7 |
|||
setPersistentData($key, $value) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
getPersistentData($key, $default = false) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
clearPersistentData($key) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
clearAllPersistentData() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 3 |
|||
api( /* polymorphic */ ) | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 11 |
|||
createTestUser(array $permissions) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 14 |
|||
deleteTestUser($testUserID) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 8 |
|||
getLastPostsForTestUser() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
<?php | |
/** | |
* @author tiger | |
*/ | |
namespace Codeception\Util\Driver; | |
class Facebook extends \BaseFacebook | |
{ | |
protected $logCallback; | |
public function __construct($config, $logCallback = null) | |
{ | |
if (is_callable($logCallback)) { | |
$this->logCallback = $logCallback; | |
} | |
parent::__construct($config); // TODO: Change the autogenerated stub | |
} | |
/** | |
* @inheritdoc | |
*/ | |
protected function setPersistentData($key, $value) | |
{ | |
// TODO: Implement setPersistentData() method. | |
} | |
/** | |
* @inheritdoc | |
*/ | |
protected function getPersistentData($key, $default = false) | |
{ | |
// TODO: Implement getPersistentData() method. | |
} | |
/** | |
* @inheritdoc | |
*/ | |
protected function clearPersistentData($key) | |
{ | |
// TODO: Implement clearPersistentData() method. | |
} | |
/** | |
* @inheritdoc | |
*/ | |
protected function clearAllPersistentData() | |
{ | |
// TODO: Implement clearAllPersistentData() method. | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function api( /* polymorphic */ ) | |
{ | |
if (is_callable($this->logCallback)) { | |
call_user_func($this->logCallback, 'Facebook API request', json_encode(func_get_args())); | |
} | |
$response = call_user_func_array('parent::api', func_get_args()); | |
if (is_callable($this->logCallback)) { | |
call_user_func($this->logCallback, 'Facebook API response', json_encode($response)); | |
} | |
return $response; | |
} | |
/** | |
* @param array $permissions | |
* | |
* @return array | |
*/ | |
public function createTestUser(array $permissions) | |
{ | |
$response = $this->api( | |
$this->getAppId() . '/accounts/test-users', | |
'POST', | |
array( | |
'installed' => true, | |
'permissions' => implode(',', $permissions), | |
'access_token' => $this->getApplicationAccessToken(), | |
) | |
); | |
// set user access token | |
$this->setAccessToken($response['access_token']); | |
return $response; | |
} | |
public function deleteTestUser($testUserID) | |
{ | |
$this->api( | |
$testUserID, | |
'DELETE', | |
array('access_token' => $this->getApplicationAccessToken()) | |
); | |
} | |
public function getLastPostsForTestUser() | |
{ | |
return $this->api('me/posts', 'GET'); | |
} | |
} |