From 4b8a9a5189a625bf99fedec7fd31f6e146410a14 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 26 Apr 2018 01:00:12 +0200 Subject: Update FB API library --- lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php') diff --git a/lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php b/lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php index ecad26f..3b18b56 100644 --- a/lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php +++ b/lib/facebook-graph-sdk/tests/Http/GraphRawResponseTest.php @@ -1,6 +1,6 @@ '*', ]; + protected $jsonFakeHeader = 'x-fb-ads-insights-throttle: {"app_id_util_pct": 0.00,"acc_id_util_pct": 0.00}'; + protected $jsonFakeHeaderAsArray = ['x-fb-ads-insights-throttle' => '{"app_id_util_pct": 0.00,"acc_id_util_pct": 0.00}']; + public function testCanSetTheHeadersFromAnArray() { $myHeaders = [ @@ -79,4 +82,12 @@ HEADER; $this->assertEquals($this->fakeHeadersAsArray, $headers); $this->assertEquals(200, $httpResponseCode); } + + public function testCanTransformJsonHeaderValues() + { + $response = new GraphRawResponse($this->jsonFakeHeader, ''); + $headers = $response->getHeaders(); + + $this->assertEquals($this->jsonFakeHeaderAsArray['x-fb-ads-insights-throttle'], $headers['x-fb-ads-insights-throttle']); + } } -- cgit v1.2.3