feat: add secure on-demand HLS playback plugin

This commit is contained in:
root
2026-09-04 20:23:10 +02:00
commit 6fae6a3a43
35 changed files with 2283 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Plugin\AzuraCastOnDemandHls\Tests;
use InvalidArgumentException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Plugin\AzuraCastOnDemandHls\Config;
#[CoversClass(Config::class)]
final class ConfigTest extends TestCase
{
public function testDefaultsAreProductionSafe(): void
{
$config = new Config();
self::assertTrue($config->enabled);
self::assertSame(1800, $config->sessionTtl);
self::assertSame(6, $config->segmentDuration);
self::assertGreaterThanOrEqual($config->sessionTtl, $config->cacheTtl);
}
public function testTraversalCannotBeUsedAsCacheDirectory(): void
{
$this->expectException(InvalidArgumentException::class);
new Config(cacheDirectory: '../outside');
}
}