Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
abraham committed Jul 24, 2023
1 parent 3368afe commit 33a7f71
Show file tree
Hide file tree
Showing 2 changed files with 2,410 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/TwitterOAuthMediaTest.php
Expand Up @@ -88,4 +88,22 @@ public function testPostStatusesUpdateWithMediaChunked()
$result = $this->twitter->post('statuses/destroy/' . $result->id_str);
return $result;
}

/**
* @vcr testPostStatusesUpdateWithMediaChunkedException.json
*/
public function testPostStatusesUpdateWithMediaChunkedException()
{
$this->expectException(
\Abraham\TwitterOAuth\TwitterOAuthException::class
);
$this->expectErrorMessage('Missing "media_id_string"');
// Video source http://www.sample-videos.com/
$file_path = __DIR__ . '/video.mp4';
$result = $this->twitter->upload(
'media/upload',
['media' => $file_path, 'media_type' => 'video/mp4'],
true,
);
}
}

0 comments on commit 33a7f71

Please sign in to comment.