Adjust expected DateTime format to gpodder - UTC ISO 8601
This commit is contained in:
parent
795a9253d2
commit
3534c43976
@ -17,6 +17,8 @@ class EpisodeActionSaver
|
||||
private EpisodeActionWriter $episodeActionWriter;
|
||||
private EpisodeActionReader $episodeActionReader;
|
||||
|
||||
const DATETIME_FORMAT = 'Y-m-d\TH:i:s';
|
||||
|
||||
public function __construct(
|
||||
EpisodeActionRepository $episodeActionRepository,
|
||||
EpisodeActionWriter $episodeActionWriter,
|
||||
|
@ -7,10 +7,12 @@ use Test\TestCase;
|
||||
|
||||
class EpisodeActionRequestTimestampConversionTest extends TestCase
|
||||
{
|
||||
public function testTimestampConversion()
|
||||
public function testDateTimeFormatIsEnsured(): void
|
||||
{
|
||||
$episodeActionTimestamp = "Tue May 18 23:45:11 GMT+02:00 2021";
|
||||
$datetime = \DateTime::createFromFormat('D F d H:i:s T Y', $episodeActionTimestamp);
|
||||
$this->assertEquals("2021-05-18T23:45:11", $datetime->format("Y-m-d\TH:i:s"));
|
||||
$episodeActionTimestamp = "2021-05-18T23:45:11";
|
||||
$datetime = \DateTime::createFromFormat('Y-m-d\TH:i:s', $episodeActionTimestamp)
|
||||
->format('Y-m-d\TH:i:s');
|
||||
$this->assertEquals($episodeActionTimestamp, $datetime);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user