2026-06-22 18:47:50 +03:00
|
|
|
<?php
|
|
|
|
|
|
2026-06-24 22:35:33 +03:00
|
|
|
use XcVm\Core\Util\StreamUtils;
|
2026-06-22 18:47:50 +03:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers StreamUtils
|
|
|
|
|
*/
|
|
|
|
|
final class StreamUtilsTest extends TestCase {
|
|
|
|
|
|
|
|
|
|
public function testCustomOrderPutsInputArgumentsFirst() {
|
|
|
|
|
$this->assertSame(-1, StreamUtils::customOrder('-i input.ts', 'something'));
|
|
|
|
|
$this->assertSame(1, StreamUtils::customOrder('-c:v libx264', '-i input.ts'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testDetectXcVmMatchesKnownStreamPaths() {
|
|
|
|
|
$this->assertTrue(StreamUtils::detectXC_VM('http://host/live/user/123'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testDetectXcVmRejectsUnrelatedPaths() {
|
|
|
|
|
$this->assertFalse(StreamUtils::detectXC_VM('http://host/dashboard'));
|
|
|
|
|
}
|
|
|
|
|
}
|