path = tempnam(sys_get_temp_dir(), 'kant-backlog-'); $this->db = ConnectionFactory::create('sqlite:///'.str_replace('\\', '/', $this->path)); TestSchema::build($this->db); $this->db->insert('website', ['id' => 'default', 'name' => 'KantSites', 'default_locale' => 'de', 'theme' => '{}']); $this->db->insert('page', ['id' => 'page-1', 'slug' => 'home', 'path' => 'home', 'type' => 'page', 'locale' => 'de', 'website_id' => 'default', 'version' => 0, 'created_at' => gmdate('Y-m-d H:i:s')]); $media = new MediaLibrary($this->db, $this->path.'-media'); $this->site = new SiteSettings($this->db, $media); $this->pages = new PageRepository($this->db, new DocumentValidator(), $this->site); $this->partials = new PartialRepository($this->db, new DocumentValidator()); $this->posts = new PostRepository($this->db, $media, $this->site); foreach (DemoContent::areas() as $kind => $area) { $this->partials->create($kind, 'default', $area['name'], $area['document']); } } protected function tearDown(): void { $this->db->close(); gc_collect_cycles(); @unlink($this->path); } private function publishHome(array $document): void { $document['schemaVersion'] = 23; $version = (int) ($this->pages->findForEditor('page-1')['version'] ?? 0); $this->pages->publish('page-1', $this->pages->saveDraft('page-1', $document, $version), $version + 1); } private function post(string $slug, string $title, string $date, array $categories = []): string { $id = $this->pages->createPage($slug, null, 'post', DemoContent::starter($title, 'post')); $this->posts->saveMetadata($id, ['publishedAt' => $date], $categories, [], $this->pages->findForEditor($id)['version']); $seite = $this->pages->findForEditor($id); $this->pages->publish($id, $seite['draft_revision_id'], $seite['version']); return $id; } public function testArchivesRunThroughThePageChainWithFooterSectionsAndPagination(): void { for ($i = 1; $i <= 12; ++$i) { $this->post('beitrag-'.$i, 'Beitrag '.$i, sprintf('2026-01-%02d', $i), ['Projekte']); } // Der Fuß verknüpft eine Sektion mit eigenem CSS - das Archiv muss beides zeigen. $sektion = DemoContent::starter('Fußsektion'); $sektion['schemaVersion'] = 23; $sektion['blocks'] = [['id' => 'fuss-hinweis', 'type' => 'text', 'props' => ['text' => 'Aus der Fußsektion'], 'css' => '& p{letter-spacing:0.3em}']]; $this->partials->create('section', 'fusssektion', 'Fußsektion', $sektion); $footer = $this->partials->findByKind('footer'); $doc = $footer['document']; $doc['schemaVersion'] = 23; $doc['blocks'][] = ['id' => 'fuss-ref', 'type' => 'partialref', 'props' => ['partial' => 'fusssektion']]; $this->partials->save($footer['id'], $doc, $footer['version']); $this->site->save(['country' => 'DE', 'homePath' => 'home', 'scrollTop' => '1', 'scrollTopLabel' => 'Nach oben']); $antwort = $this->request('/beitraege'); $html = $antwort->getContent(); self::assertSame(200, $antwort->getStatusCode()); self::assertStringContainsString('