33 lines
815 B
PHP
33 lines
815 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Blax\WebRtc\Tests;
|
|
|
|
use Blax\WebRtc\Media\NullMediaEngine;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
final class NullMediaEngineTest extends TestCase
|
|
{
|
|
public function test_it_refuses_to_terminate_media(): void
|
|
{
|
|
$this->expectException(\RuntimeException::class);
|
|
|
|
(new NullMediaEngine)->offer('p1', 'sdp');
|
|
}
|
|
|
|
public function test_its_other_operations_are_harmless_no_ops(): void
|
|
{
|
|
$engine = new NullMediaEngine;
|
|
|
|
$engine->addIceCandidate('p1', ['candidate' => 'x']);
|
|
$engine->startRecording('p1', '/tmp/x.opus');
|
|
$engine->stopRecording('p1');
|
|
$engine->connectPeers('p1', 'p2');
|
|
$engine->bridge('p1', []);
|
|
$engine->close('p1');
|
|
|
|
$this->assertSame('null', $engine->name());
|
|
}
|
|
}
|