feat: add secure on-demand HLS playback plugin
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user