$request->mode('absolute'); expect($request->line())->toBe('GET http://www.domain.com/index.php HTTP/1.1'); }); it("sets the asterisk mode", function () { $request = new Request(['scheme' => 'http', 'host' => 'www.domain.com', 'path' => 'index.php']); expect($request->line())->toBe('GET /index.php HTTP/1.1'); $request->method('OPTIONS'); $request->mode('asterisk'); expect($request->line())->toBe('OPTIONS * HTTP/1.1'); }); }); describe("->requestTarget()", function () { it("sets the request mode", function () { $request = new Request(['method' => 'CONNECT', 'host' => 'www.domain.com', 'username' => 'username', 'password' => 'password', 'path' => 'index.php']); expect($request->line())->toBe('CONNECT username:password@www.domain.com HTTP/1.1'); $request->port(8000); expect($request->line())->toBe('CONNECT username:password@www.domain.com:8000 HTTP/1.1'); }); }); describe("->query()", function () { it("gets/sets the query string", function () { $expected = "?param=value¶m1=value1"; $request = new Request(); expect($request->query(['param' => 'value', 'param1' => 'value1']))->toBe($request); expect($request->query())->toBe(['param' => 'value', 'param1' => 'value1']); expect($request->requestTarget())->toBe('/?param=value¶m1=value1'); }); }); describe("->auth()", function () { it("sets a basic Authorization header", function () { $request = new Request(['username' => 'Willy', 'password' => 'Boy', 'auth' => 'Basic']);