mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-28 03:03:18 +01: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.
36 lines
774 B
PHP
36 lines
774 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chrisyue\PhpM3u8\Test\Data\Value;
|
|
|
|
use Chrisyue\PhpM3u8\Data\Value\Byterange;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ByterangeTest extends TestCase
|
|
{
|
|
/**
|
|
* @dataProvider dataProvider
|
|
*/
|
|
public function testFromString($string, Byterange $byterange): void
|
|
{
|
|
$this->assertEquals($byterange, Byterange::fromString($string));
|
|
}
|
|
|
|
/**
|
|
* @dataProvider dataProvider
|
|
*/
|
|
public function testToString($string, Byterange $byterange): void
|
|
{
|
|
$this->assertEquals($string, (string) $byterange);
|
|
}
|
|
|
|
public function dataProvider(): array
|
|
{
|
|
return [
|
|
['2000', new Byterange(2000)],
|
|
['2000@1000', new Byterange(2000, 1000)],
|
|
];
|
|
}
|
|
}
|