|
4 | 4 |
|
5 | 5 | use Illuminate\Support\Facades\Route; |
6 | 6 |
|
7 | | -it('can visit subdomain routes with browser testing', function (): void { |
8 | | - Route::domain('app.localhost')->group(function (): void { |
9 | | - Route::get('/', fn (): string => ' |
10 | | - <html> |
11 | | - <head><title>App Subdomain</title></head> |
12 | | - <body> |
13 | | - <h1>Welcome to App Subdomain</h1> |
14 | | - <div id="content">This is the app subdomain content</div> |
15 | | - </body> |
16 | | - </html> |
17 | | - '); |
18 | | - }); |
| 7 | +it('can visit non-subdomain routes with subdomain host browser testing', function (): void { |
| 8 | + Route::get('/app-test', fn (): string => ' |
| 9 | + <html> |
| 10 | + <head><title>Non Subdomain</title></head> |
| 11 | + <body> |
| 12 | + <h1>Welcome to NON Subdomain</h1> |
| 13 | + <div id="content">This is the non subdomain content</div> |
| 14 | + </body> |
| 15 | + </html> |
| 16 | + '); |
19 | 17 |
|
20 | 18 | pest()->browser()->withHost('app.localhost'); |
21 | 19 |
|
22 | | - visit('/') |
23 | | - ->assertSee('Welcome to App Subdomain') |
24 | | - ->assertSeeIn('#content', 'This is the app subdomain content') |
25 | | - ->assertTitle('App Subdomain'); |
| 20 | + visit('/app-test') |
| 21 | + ->assertSee('Welcome to NON Subdomain') |
| 22 | + ->assertSeeIn('#content', 'This is the non subdomain content') |
| 23 | + ->assertTitle('Non Subdomain'); |
26 | 24 | }); |
27 | 25 |
|
28 | | -it('works with Laravel Sail style subdomains', function (): void { |
| 26 | +it('works with Laravel subdomain style', function (): void { |
29 | 27 | // Simulate Laravel Sail subdomain routing pattern |
30 | 28 | Route::domain('{subdomain}.localhost')->group(function (): void { |
31 | 29 | Route::get('/api/health', fn (): array => [ |
|
0 commit comments