-
Notifications
You must be signed in to change notification settings - Fork 0
sync with pest repo #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
13562a8
28a6465
9cd9195
ca9dbf4
dc7e66c
2dfd31e
1bca25a
72cb88b
0ed837a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |||||
| declare(strict_types=1); | ||||||
|
|
||||||
| use Illuminate\Support\Facades\Route; | ||||||
| use Pest\Browser\Playwright\Playwright; | ||||||
|
|
||||||
| it('can visit non-subdomain routes with subdomain host browser testing', function (): void { | ||||||
| Route::get('/app-test', fn (): string => ' | ||||||
|
|
@@ -40,3 +41,141 @@ | |||||
| ->assertSee('"subdomain":"api"') | ||||||
| ->assertSee('"host":"api.localhost"'); | ||||||
| }); | ||||||
|
|
||||||
| it('Can chain withHost on visit', function (): void { | ||||||
|
||||||
| Route::domain('{subdomain}.localhost')->group(function (): void { | ||||||
| Route::get('/api/health', fn (): array => [ | ||||||
| 'status' => 'ok', | ||||||
| 'subdomain' => request()->route('subdomain'), | ||||||
| 'host' => request()->getHost(), | ||||||
| ]); | ||||||
| }); | ||||||
|
|
||||||
| visit('/api/health') | ||||||
| ->withHost('api.localhost') | ||||||
| ->assertSee('"status":"ok"') | ||||||
| ->assertSee('"subdomain":"api"') | ||||||
| ->assertSee('"host":"api.localhost"'); | ||||||
| }); | ||||||
|
|
||||||
| it('Chaining withHost will not override global host', function (): void { | ||||||
|
||||||
| it('Chaining withHost will not override global host', function (): void { | |
| it('chaining withHost will not override global host', function (): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment is missing a period at the end of the sentence, which is inconsistent with other documentation comments in the codebase (e.g., line 599 "Sets the host for the server.").