Merge branch 'dashboard-modifications' into share-files

This commit is contained in:
Marcel Pociot
2021-05-19 11:57:25 +02:00
8 changed files with 170 additions and 114 deletions

View File

@@ -9,7 +9,9 @@ use App\Logger\LoggedRequest;
use App\Logger\RequestLogger;
use Clue\React\Buzz\Browser;
use Clue\React\Buzz\Message\ResponseException;
use GuzzleHttp\Psr7\Message;
use GuzzleHttp\Psr7\Request;
use Illuminate\Support\Arr;
use function GuzzleHttp\Psr7\str;
use Mockery as m;
use Psr\Http\Message\RequestInterface;
@@ -63,7 +65,10 @@ class DashboardTest extends TestCase
$httpClient = m::mock(HttpClient::class);
$httpClient->shouldReceive('performRequest')
->once()
->with(str($request));
->withArgs(function ($arg) {
$sentRequest = Message::parseMessage($arg);
return Arr::get($sentRequest, 'start-line') === 'GET /example HTTP/1.1';
});
app()->instance(HttpClient::class, $httpClient);

View File

@@ -59,7 +59,7 @@ class TunnelTest extends TestCase
$this->expectException(ResponseException::class);
$this->expectExceptionMessage(404);
$response = $this->await($this->browser->get('http://127.0.0.1:8080/', [
$this->await($this->browser->get('http://127.0.0.1:8080/', [
'Host' => 'tunnel.localhost',
]));
}
@@ -67,6 +67,8 @@ class TunnelTest extends TestCase
/** @test */
public function it_sends_incoming_requests_to_the_connected_client()
{
$this->app['config']['expose.admin.validate_auth_tokens'] = false;
$this->createTestHttpServer();
$this->app['config']['expose.admin.validate_auth_tokens'] = false;