Files
Testing/mongolian/source/server/vendor/react/socket/tests/SecureServerTest.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

40 lines
1.1 KiB
PHP

<?php
namespace React\Tests\Socket;
use React\Socket\SecureServer;
class SecureServerTest extends TestCase
{
public function setUp()
{
if (!function_exists('stream_socket_enable_crypto')) {
$this->markTestSkipped('Not supported on your platform (outdated HHVM?)');
}
}
public function testGetPortWillBePassedThroughToTcpServer()
{
$tcp = $this->getMockBuilder('React\Socket\Server')->disableOriginalConstructor()->getMock();
$tcp->expects($this->once())->method('getPort')->willReturn(1234);
$loop = $this->getMock('React\EventLoop\LoopInterface');
$server = new SecureServer($tcp, $loop, array());
$this->assertEquals(1234, $server->getPort());
}
public function testShutdownWillBePassedThroughToTcpServer()
{
$tcp = $this->getMockBuilder('React\Socket\Server')->disableOriginalConstructor()->getMock();
$tcp->expects($this->once())->method('shutdown');
$loop = $this->getMock('React\EventLoop\LoopInterface');
$server = new SecureServer($tcp, $loop, array());
$server->shutdown();
}
}