Skip to content

Commit

Permalink
5.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMallison committed May 4, 2015
1 parent 714e5e1 commit 90ccc1d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/TwitterAPIExchangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ public function testMediaUpload()

$url = 'https://upload.twitter.com/1.1/media/upload.json';
$method = 'POST';
$params = [
$params = array(
'media_data' => $data
];
);

$data = $this->exchange->request($url, $method, $params);
$expected = 'image\/png';
Expand All @@ -188,7 +188,7 @@ public function testMediaUpload()
/** Store the media id for later **/
$data = @json_decode($data, true);

$this->assertArrayHasKey('media_id', is_array($data) ? $data : []);
$this->assertArrayHasKey('media_id', is_array($data) ? $data : array());

self::$mediaId = $data['media_id'];
}
Expand All @@ -207,10 +207,10 @@ public function testStatusesUpdate()

$url = 'https://api.twitter.com/1.1/statuses/update.json';
$method = 'POST';
$params = [
$params = array(
'status' => 'TEST TWEET TO BE DELETED' . rand(),
'media_ids' => self::$mediaId
];
);

$data = $this->exchange->request($url, $method, $params);
$expected = 'TEST TWEET TO BE DELETED';
Expand All @@ -220,7 +220,7 @@ public function testStatusesUpdate()
/** Store the tweet id for testStatusesDestroy() **/
$data = @json_decode($data, true);

$this->assertArrayHasKey('id_str', is_array($data) ? $data : []);
$this->assertArrayHasKey('id_str', is_array($data) ? $data : array());

self::$tweetId = $data['id_str'];

Expand All @@ -242,9 +242,9 @@ public function testStatusesDestroy()

$url = sprintf('https://api.twitter.com/1.1/statuses/destroy/%d.json', self::$tweetId);
$method = 'POST';
$params = [
$params = array(
'id' => self::$tweetId
];
);

$data = $this->exchange->request($url, $method, $params);
$expected = 'TEST TWEET TO BE DELETED';
Expand Down

0 comments on commit 90ccc1d

Please sign in to comment.