test(core): unit tests for Util/Database/Enum pure logic (+44 tests)

Adds tests for Encryption, TimeUtils, QueryHelper, AdminHelpers, ImageUtils,
StreamUtils and BootContext/ServerEnvironment enums. 242 -> 286 tests, all green.
This commit is contained in:
Divarion-D
2026-06-22 18:47:50 +03:00
parent 9d49ddd7e9
commit 5ce38ea61f
7 changed files with 339 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
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'));
}
}