seed(\Database\Seeders\RolesSeeder::class); $this->tenant = Tenant::firstOrCreate( ['name' => 'Test Schule'], ['type' => 'school', 'active' => true] ); $this->user = User::withoutGlobalScopes()->create([ 'name' => 'Lina Test', 'email' => 'lina@nested.test', 'tenant_id' => $this->tenant->id, 'password' => bcrypt('password'), ]); $childRole = Role::where('name', 'child')->first(); DB::table('role_user')->insert([ 'user_id' => $this->user->id, 'role_id' => $childRole->id, 'created_at' => now(), 'updated_at' => now(), ]); $license = License::withoutGlobalScopes()->create([ 'tenant_id' => $this->tenant->id, 'type' => 'school_flat', 'seats' => null, 'expires_at' => now()->addYear(), 'active' => true, ]); DB::table('license_assignments')->insert([ 'license_id' => $license->id, 'user_id' => $this->user->id, 'created_at' => now(), 'updated_at' => now(), ]); }); function assertNoNestedButtons(string $html, string $page): void { $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML('
' . $html . '
', LIBXML_NOERROR | LIBXML_NOWARNING); libxml_clear_errors(); $xpath = new DOMXPath($doc); $nestedButtons = $xpath->query('//button//button'); $count = $nestedButtons === false ? 0 : $nestedButtons->length; expect($count)->toBe( 0, "Page '{$page}' must not contain