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 ++++++++++++- .../tests/Http/RequestBodyMultipartTest.php | 2 +- lib/facebook-graph-sdk/tests/Http/RequestUrlEncodedTest.php | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'lib/facebook-graph-sdk/tests/Http') 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']); + } } diff --git a/lib/facebook-graph-sdk/tests/Http/RequestBodyMultipartTest.php b/lib/facebook-graph-sdk/tests/Http/RequestBodyMultipartTest.php index 267cc49..1a23c46 100644 --- a/lib/facebook-graph-sdk/tests/Http/RequestBodyMultipartTest.php +++ b/lib/facebook-graph-sdk/tests/Http/RequestBodyMultipartTest.php @@ -1,6 +1,6 @@