Skip to content

Commit

Permalink
Update test to stable http-server API
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Oct 8, 2023
1 parent f92576a commit a16937d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/ClientCookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
use Amp\Http\Client\Request;
use Amp\Http\Cookie\CookieAttributes;
use Amp\Http\Cookie\ResponseCookie;
use Amp\Http\HttpStatus;
use Amp\Http\Server\DefaultErrorHandler;
use Amp\Http\Server\Driver\DefaultHttpDriverFactory;
use Amp\Http\Server\HttpServer;
use Amp\Http\Server\RequestHandler\ClosureRequestHandler;
use Amp\Http\Server\Response as ServerResponse;
use Amp\Http\Server\SocketHttpServer;
use Amp\Http\Status;
use Amp\Socket;
use Psr\Log\NullLogger;

Expand All @@ -37,7 +37,7 @@ public function setUp(): void

$logger = new NullLogger();

$this->server = new SocketHttpServer(
$this->server = SocketHttpServer::createForDirectAccess(
$logger,
httpDriverFactory: new DefaultHttpDriverFactory($logger, streamTimeout: 1, connectionTimeout: 1),
);
Expand All @@ -46,7 +46,7 @@ public function setUp(): void

$this->server->start(
new ClosureRequestHandler(
fn () => new ServerResponse(Status::OK, ['set-cookie' => $this->cookieHeader]),
fn () => new ServerResponse(HttpStatus::OK, ['set-cookie' => $this->cookieHeader]),
),
new DefaultErrorHandler(),
);
Expand Down

0 comments on commit a16937d

Please sign in to comment.