mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-11-08 03:03:35 +01:00
No bootAll() caller ever passed a StreamPipeline, so a module's getStreamMiddleware() was never called and the pipeline never ran. The pipeline class and ModuleLoader's wiring (the unused third bootAll() parameter) are gone. StreamMiddlewareProviderInterface, StreamMiddlewareInterface and StreamContext stay, marked deprecated, so a module that still implements them keeps loading.
27 lines
845 B
PHP
27 lines
845 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use XcVm\Core\Http\Pipeline\StreamContext;
|
|
|
|
/** StreamContext, kept for the deprecated stream-middleware contract. */
|
|
final class StreamContextTest extends TestCase {
|
|
public function testAttributeBag(): void {
|
|
$ctx = new StreamContext(1, 'u', 'hls', []);
|
|
$ctx->set('key', 'value');
|
|
|
|
$this->assertTrue($ctx->has('key'));
|
|
$this->assertSame('value', $ctx->get('key'));
|
|
$this->assertNull($ctx->get('missing'));
|
|
}
|
|
|
|
public function testAbort(): void {
|
|
$ctx = new StreamContext(1, 'u', 'hls', []);
|
|
$this->assertFalse($ctx->isAborted());
|
|
$ctx->abort('blocked', 403);
|
|
|
|
$this->assertTrue($ctx->isAborted());
|
|
$this->assertSame('blocked', $ctx->getAbortReason());
|
|
$this->assertSame(403, $ctx->getAbortCode());
|
|
}
|
|
}
|