‰PNG
IHDR è è ÂÁC³ ×IDATxÚíÖ1
À°ù7
89šTÁ®5 <' w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ» `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î € `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î € `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸K Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã H Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã H Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã Æ 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w 0î €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q Œ; w À¸ €q Œ; `Ü À¸ Æ 0î `Ü ã w 0î €q ã w À¸ €q Œ; `Ü À¸ Æ Œ; `Ü ã Æ 0î €q ã w À¸ €q Œ; w À¸ Æ Œ; `Ü ã Æ 0î `Ü ã w 0î €q ŽºÆá¾d“é IEND®B`‚
/home/wespack/public_html/admin/vendors/fbsdk/tests
Edit: /home/wespack/public_html/admin/vendors/fbsdk/tests/FacebookClientTest.php (11373B)
fbApp = new FacebookApp('id', 'shhhh!');
$this->fbClient = new FacebookClient(new MyFooClientHandler());
}
public function testACustomHttpClientCanBeInjected()
{
$handler = new MyFooClientHandler();
$client = new FacebookClient($handler);
$httpHandler = $client->getHttpClientHandler();
$this->assertInstanceOf('Facebook\Tests\MyFooClientHandler', $httpHandler);
}
public function testTheHttpClientWillFallbackToDefault()
{
$client = new FacebookClient();
$httpHandler = $client->getHttpClientHandler();
if (function_exists('curl_init')) {
$this->assertInstanceOf('Facebook\HttpClients\FacebookCurlHttpClient', $httpHandler);
} else {
$this->assertInstanceOf('Facebook\HttpClients\FacebookStreamHttpClient', $httpHandler);
}
}
public function testBetaModeCanBeDisabledOrEnabledViaConstructor()
{
$client = new FacebookClient(null, false);
$url = $client->getBaseGraphUrl();
$this->assertEquals(FacebookClient::BASE_GRAPH_URL, $url);
$client = new FacebookClient(null, true);
$url = $client->getBaseGraphUrl();
$this->assertEquals(FacebookClient::BASE_GRAPH_URL_BETA, $url);
}
public function testBetaModeCanBeDisabledOrEnabledViaMethod()
{
$client = new FacebookClient();
$client->enableBetaMode(false);
$url = $client->getBaseGraphUrl();
$this->assertEquals(FacebookClient::BASE_GRAPH_URL, $url);
$client->enableBetaMode(true);
$url = $client->getBaseGraphUrl();
$this->assertEquals(FacebookClient::BASE_GRAPH_URL_BETA, $url);
}
public function testGraphVideoUrlCanBeSet()
{
$client = new FacebookClient();
$client->enableBetaMode(false);
$url = $client->getBaseGraphUrl($postToVideoUrl = true);
$this->assertEquals(FacebookClient::BASE_GRAPH_VIDEO_URL, $url);
$client->enableBetaMode(true);
$url = $client->getBaseGraphUrl($postToVideoUrl = true);
$this->assertEquals(FacebookClient::BASE_GRAPH_VIDEO_URL_BETA, $url);
}
public function testAFacebookRequestEntityCanBeUsedToSendARequestToGraph()
{
$fbRequest = new FacebookRequest($this->fbApp, 'token', 'GET', '/foo');
$response = $this->fbClient->sendRequest($fbRequest);
$this->assertInstanceOf('Facebook\FacebookResponse', $response);
$this->assertEquals(200, $response->getHttpStatusCode());
$this->assertEquals('{"data":[{"id":"123","name":"Foo"},{"id":"1337","name":"Bar"}]}', $response->getBody());
}
public function testAFacebookBatchRequestEntityCanBeUsedToSendABatchRequestToGraph()
{
$fbRequests = [
new FacebookRequest($this->fbApp, 'token', 'GET', '/foo'),
new FacebookRequest($this->fbApp, 'token', 'POST', '/bar'),
];
$fbBatchRequest = new FacebookBatchRequest($this->fbApp, $fbRequests);
$fbBatchClient = new FacebookClient(new MyFooBatchClientHandler());
$response = $fbBatchClient->sendBatchRequest($fbBatchRequest);
$this->assertInstanceOf('Facebook\FacebookBatchResponse', $response);
$this->assertEquals('GET', $response[0]->getRequest()->getMethod());
$this->assertEquals('POST', $response[1]->getRequest()->getMethod());
}
public function testAFacebookBatchRequestWillProperlyBatchFiles()
{
$fbRequests = [
new FacebookRequest($this->fbApp, 'token', 'POST', '/photo', [
'message' => 'foobar',
'source' => new FacebookFile(__DIR__ . '/foo.txt'),
]),
new FacebookRequest($this->fbApp, 'token', 'POST', '/video', [
'message' => 'foobar',
'source' => new FacebookVideo(__DIR__ . '/foo.txt'),
]),
];
$fbBatchRequest = new FacebookBatchRequest($this->fbApp, $fbRequests);
$fbBatchRequest->prepareRequestsForBatch();
list($url, $method, $headers, $body) = $this->fbClient->prepareRequestMessage($fbBatchRequest);
$this->assertEquals(FacebookClient::BASE_GRAPH_VIDEO_URL . '/' . Facebook::DEFAULT_GRAPH_VERSION, $url);
$this->assertEquals('POST', $method);
$this->assertContains('multipart/form-data; boundary=', $headers['Content-Type']);
$this->assertContains('Content-Disposition: form-data; name="batch"', $body);
$this->assertContains('Content-Disposition: form-data; name="include_headers"', $body);
$this->assertContains('"name":0,"attached_files":', $body);
$this->assertContains('"name":1,"attached_files":', $body);
$this->assertContains('"; filename="foo.txt"', $body);
}
public function testARequestOfParamsWillBeUrlEncoded()
{
$fbRequest = new FacebookRequest($this->fbApp, 'token', 'POST', '/foo', ['foo' => 'bar']);
$response = $this->fbClient->sendRequest($fbRequest);
$headersSent = $response->getRequest()->getHeaders();
$this->assertEquals('application/x-www-form-urlencoded', $headersSent['Content-Type']);
}
public function testARequestWithFilesWillBeMultipart()
{
$myFile = new FacebookFile(__DIR__ . '/foo.txt');
$fbRequest = new FacebookRequest($this->fbApp, 'token', 'POST', '/foo', ['file' => $myFile]);
$response = $this->fbClient->sendRequest($fbRequest);
$headersSent = $response->getRequest()->getHeaders();
$this->assertContains('multipart/form-data; boundary=', $headersSent['Content-Type']);
}
/**
* @group integration
*/
public function testCanCreateATestUserAndGetTheProfileAndThenDeleteTheTestUser()
{
$this->initializeTestApp();
// Create a test user
$testUserPath = '/' . FacebookTestCredentials::$appId . '/accounts/test-users';
$params = [
'installed' => true,
'name' => 'Foo Phpunit User',
'locale' => 'en_US',
'permissions' => implode(',', ['read_stream', 'user_photos']),
];
$request = new FacebookRequest(
static::$testFacebookApp,
static::$testFacebookApp->getAccessToken(),
'POST',
$testUserPath,
$params
);
$response = static::$testFacebookClient->sendRequest($request)->getGraphNode();
$testUserId = $response->getField('id');
$testUserAccessToken = $response->getField('access_token');
// Get the test user's profile
$request = new FacebookRequest(
static::$testFacebookApp,
$testUserAccessToken,
'GET',
'/me'
);
$graphNode = static::$testFacebookClient->sendRequest($request)->getGraphNode();
$this->assertInstanceOf('Facebook\GraphNodes\GraphNode', $graphNode);
$this->assertNotNull($graphNode->getField('id'));
$this->assertEquals('Foo Phpunit User', $graphNode->getField('name'));
// Delete test user
$request = new FacebookRequest(
static::$testFacebookApp,
static::$testFacebookApp->getAccessToken(),
'DELETE',
'/' . $testUserId
);
$graphNode = static::$testFacebookClient->sendRequest($request)->getGraphNode();
$this->assertTrue($graphNode->getField('success'));
}
public function initializeTestApp()
{
if (!file_exists(__DIR__ . '/FacebookTestCredentials.php')) {
throw new FacebookSDKException(
'You must create a FacebookTestCredentials.php file from FacebookTestCredentials.php.dist'
);
}
if (!strlen(FacebookTestCredentials::$appId) ||
!strlen(FacebookTestCredentials::$appSecret)
) {
throw new FacebookSDKException(
'You must fill out FacebookTestCredentials.php'
);
}
static::$testFacebookApp = new FacebookApp(
FacebookTestCredentials::$appId,
FacebookTestCredentials::$appSecret
);
// Use default client
$client = null;
// Uncomment to enable curl implementation.
//$client = new FacebookCurlHttpClient();
// Uncomment to enable stream wrapper implementation.
//$client = new FacebookStreamHttpClient();
// Uncomment to enable Guzzle implementation.
//$client = new FacebookGuzzleHttpClient();
static::$testFacebookClient = new FacebookClient($client);
}
}