Doku: Betreiber-Provisionierung, Sperrseite und systemweite Einstellungen
Dazu ein genauerer Testname: Links tragen die Hauptadresse ihrer Website, nicht die Adresse, über die der Besucher kam. Das ist der kanonische Host und war vorher falsch benannt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f2e78446a8
commit
c2cf632ad5
2 files changed
+27
-12
No files matched your search
@@ -6,6 +6,7 @@
|
||||
use App\Filament\Operator\Tenants\Pages\EditTenant;
|
||||
use App\Models\Page;
|
||||
use App\Models\Site;
|
||||
use App\Models\SiteDomain;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use App\Tenancy\TenantContext;
|
||||
@@ -86,10 +87,11 @@ public function test_the_default_notice_applies_when_none_was_written(): void
|
||||
}
|
||||
|
||||
/**
|
||||
* Links on a website have to carry the address the visitor arrived on. APP_URL is a single value, so
|
||||
* without this every link of a second landlord would point at the first landlord's host.
|
||||
* Links carry the main address of the website they belong to – not APP_URL, which is a single value and
|
||||
* would have sent every visitor of a second landlord to the first landlord's host. Visiting through a
|
||||
* further address of the same website still yields the main address, which keeps one canonical host.
|
||||
*/
|
||||
public function test_links_carry_the_address_the_visitor_came_in_on(): void
|
||||
public function test_links_carry_the_main_address_of_their_own_website(): void
|
||||
{
|
||||
config(['app.url' => 'https://erster.test']);
|
||||
$first = Tenant::factory()->create();
|
||||
@@ -98,9 +100,17 @@ public function test_links_carry_the_address_the_visitor_came_in_on(): void
|
||||
$second = Tenant::factory()->create();
|
||||
$this->websiteFor($second, 'zweiter.test');
|
||||
|
||||
$html = $this->get('http://zweiter.test/')->assertOk()->getContent();
|
||||
$html = (string) $this->get('http://zweiter.test/')->assertOk()->getContent();
|
||||
|
||||
$this->assertStringNotContainsString('erster.test', (string) $html);
|
||||
$this->assertStringNotContainsString('erster.test', $html);
|
||||
$this->assertStringContainsString('zweiter.test', $html);
|
||||
|
||||
// A further address of the same website keeps pointing at its main address.
|
||||
SiteDomain::query()->create(['site_id' => Site::withoutGlobalScope('tenant')->where('tenant_id', $second->id)->value('id'), 'host' => 'www.zweiter.test']);
|
||||
|
||||
$viaWww = (string) $this->get('http://www.zweiter.test/')->assertOk()->getContent();
|
||||
|
||||
$this->assertStringContainsString('https://zweiter.test', $viaWww);
|
||||
}
|
||||
|
||||
public function test_the_operator_adds_an_address_to_an_existing_landlord(): void
|
||||
|
||||
Reference in new issue
Block a user