mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
@@ -143,30 +143,6 @@ class AdminTest extends TestCase
|
||||
$this->assertTrue(Str::contains($body, 'Marcel'));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_can_list_all_currently_connected_sites()
|
||||
{
|
||||
/** @var ConnectionManager $connectionManager */
|
||||
$connectionManager = app(ConnectionManager::class);
|
||||
|
||||
$connection = \Mockery::mock(IoConnection::class);
|
||||
$connection->httpRequest = new Request('GET', '/?authToken=some-token');
|
||||
|
||||
$connectionManager->storeConnection('some-host.text', 'fixed-subdomain', $connection);
|
||||
|
||||
/** @var Response $response */
|
||||
$response = $this->await($this->browser->get('http://127.0.0.1:8080/sites', [
|
||||
'Host' => 'expose.localhost',
|
||||
'Authorization' => base64_encode('username:secret'),
|
||||
'Content-Type' => 'application/json',
|
||||
]));
|
||||
|
||||
$body = $response->getBody()->getContents();
|
||||
|
||||
$this->assertTrue(Str::contains($body, 'some-host.text'));
|
||||
$this->assertTrue(Str::contains($body, 'fixed-subdomain'));
|
||||
}
|
||||
|
||||
protected function startServer()
|
||||
{
|
||||
$this->app['config']['expose.admin.subdomain'] = 'expose';
|
||||
|
||||
@@ -115,6 +115,19 @@ class TunnelTest extends TestCase
|
||||
$this->assertInstanceOf(Connection::class, $connection);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_rejects_tcp_sharing_if_disabled()
|
||||
{
|
||||
$this->createTestTcpServer();
|
||||
|
||||
$this->app['config']['expose.admin.allow_tcp_port_sharing'] = false;
|
||||
|
||||
$this->expectException(\UnexpectedValueException::class);
|
||||
|
||||
$client = $this->createClient();
|
||||
$this->await($client->connectToServerAndShareTcp(8085));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_rejects_tcp_sharing_if_forbidden()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user