-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from shutupflanders/with-videos
Added `withVideo` support to `TwitterStatusUpdate`
- Loading branch information
Showing
9 changed files
with
279 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace NotificationChannels\Twitter; | ||
|
||
class TwitterVideo | ||
{ | ||
public function __construct(private string $videoPath) | ||
{ | ||
} | ||
|
||
public function getPath(): string | ||
{ | ||
return $this->videoPath; | ||
} | ||
|
||
public function getMimeType(): string | ||
{ | ||
return mime_content_type($this->videoPath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace NotificationChannels\Twitter; | ||
|
||
function mime_content_type($path) | ||
{ | ||
return 'video/mp4'; | ||
} | ||
|
||
namespace NotificationChannels\Twitter\Test; | ||
|
||
use NotificationChannels\Twitter\TwitterVideo; | ||
|
||
class TwitterVideoTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_accepts_a_video_path_when_constructing_a_twitter_video(): void | ||
{ | ||
$video = new TwitterVideo('/foo/bar/baz.mp4'); | ||
$this->assertEquals('/foo/bar/baz.mp4', $video->getPath()); | ||
$this->assertEquals('video/mp4', $video->getMimeType()); | ||
} | ||
} |