Files
XC_VM/tests/Unit/UserProxyRoutingTest.php
T
babasado 8e228b8ba1 feat: add reseller bouquet controls and panel customizations
Add per-reseller bouquet limits and per-customer selection and ordering,
while keeping package defaults for new lines and trials.

Integrate the separately installed User Proxy module through core routing
and customer form hooks, with native playback fallback.

Fix connection-counter deep links across admin and reseller pages. Add
proxy availability to dashboard status and a setting to hide Active Codes.

Include migrations 094/095, setup guides and regression coverage. Keep
local skills, installed modules and development dependencies out of Git.
2026-10-13 23:53:27 +02:00

28 lines
1.3 KiB
PHP

<?php
use PHPUnit\Framework\TestCase;
use XcVm\Core\Module\Contract\StreamRoutingProviderInterface;
use XcVm\Streaming\Routing\PlaybackRouter;
final class UserProxyRoutingTest extends TestCase {
protected function tearDown(): void { PlaybackRouter::reset(); }
public function testUnavailableAssignedProxyFallsBackToNative(): void {
$previous = $GLOBALS['rServers'] ?? null;
$GLOBALS['rServers'] = [9 => ['server_type' => 1, 'parent_id' => [3], 'server_online' => 0]];
try {
PlaybackRouter::register(new class implements StreamRoutingProviderInterface {
public function proxyFor(int $lineId): ?int { return $lineId === 42 ? 9 : null; }
});
$this->assertNull(PlaybackRouter::select(3, 42, true, 'AT', ''));
$this->assertNull(PlaybackRouter::select(3, 43, true, 'AT', ''));
} finally { $GLOBALS['rServers'] = $previous; }
}
public function testBrokenProviderFallsBackToNative(): void {
PlaybackRouter::register(new class implements StreamRoutingProviderInterface {
public function proxyFor(int $lineId): ?int { throw new RuntimeException('Unreadable assignments'); }
});
$this->assertNull(PlaybackRouter::select(3, 42, false, 'AT', ''));
}
}