Files
XC_VM/tests/Unit/StreamContextTest.php
T
Divarion_D 418c7067b4 refactor(modules): remove the stream middleware pipeline that never ran
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.
2026-09-28 21:18:46 +03:00

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());
}
}