mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-06 20:02:37 +02:00
25 lines
570 B
PHP
25 lines
570 B
PHP
<?php
|
|||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace Chrisyue\PhpM3u8\Test\Data\Transformer;
|
||
|
|
|
||
|
|
use Chrisyue\PhpM3u8\Data\Transformer\AttributeStringToArray;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
|
||
|
|
class AttributeStringToArrayTest extends TestCase
|
||
|
|
{
|
||
|
|
public function testInvoke(): void
|
||
|
|
{
|
||
|
|
$attr2Array = new AttributeStringToArray();
|
||
|
|
|
||
|
|
$string = 'FOO=BAR,URI="http://example.com/?p=1"';
|
||
|
|
$expected = [
|
||
|
|
'FOO' => 'BAR',
|
||
|
|
'URI' => '"http://example.com/?p=1"',
|
||
|
|
];
|
||
|
|
|
||
|
|
$this->assertEquals($expected, $attr2Array($string));
|
||
|
|
}
|
||
|
|
}
|