mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-12 20:02:49 +02:00
- Added `StreamInterface` to define the contract for stream handling. - Implemented `FileStream` class for file-based streaming. - Implemented `TextStream` class for in-memory text streaming. - Removed legacy `M3UParser` class and related resources. - Added new tests for `AttributeStringToArray`, `Iso8601Transformer`, `Resolution`, `Byterange`, `Inf`, `Line`, and `Lines` classes. - Updated bootstrap file to include new PhpM3u8 components.
27 lines
655 B
PHP
27 lines
655 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chrisyue\PhpM3u8\Test\Data\Transformer;
|
|
|
|
use Chrisyue\PhpM3u8\Data\Transformer\Iso8601Transformer;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class Iso8601TransformerTest extends TestCase
|
|
{
|
|
public function testFromString(): void
|
|
{
|
|
$string = '2018-01-01T01:02:03.002+08:00';
|
|
|
|
$this->assertEquals(new \DateTime($string), Iso8601Transformer::fromString($string));
|
|
}
|
|
|
|
public function testToString(): void
|
|
{
|
|
$string = '2018-01-01T01:02:03.002+08:00';
|
|
$datetime = new \DateTime($string);
|
|
|
|
$this->assertEquals($string, Iso8601Transformer::toString($datetime));
|
|
}
|
|
}
|