1 Commits

Author SHA1 Message Date
1e2217a742 ci: point deploy-test workflow to new server cp3 (46.225.136.66:9716)
All checks were successful
Lint / PHP Syntax Check (push) Successful in 1m2s
PHPUnit / PHP Unit Tests (push) Successful in 1m8s
Lint / HTML Lint (htmlhint) (push) Successful in 1m41s
Lint / CSS Lint (stylelint) (push) Successful in 1m45s
- old server 188.245.242.194 is unreachable (cp-server-1 ALT, forensic only)
- switch SSH user from haustest to root (chown added in new step)
- add composer install --no-dev (vendor/ is gitignored)
- update ssh-keyscan to new IP + port
2026-06-14 12:17:21 +02:00
8 changed files with 44 additions and 402 deletions

View File

@@ -36,19 +36,19 @@ jobs:
mkdir -p ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 188.245.242.194 >> ~/.ssh/known_hosts 2>/dev/null
ssh-keyscan -H -p 9716 46.225.136.66 >> ~/.ssh/known_hosts 2>/dev/null
echo "✅ SSH key configured"
- name: Verify SSH connectivity
if: env.skip_deploy != '1'
run: |
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 \
haustest@188.245.242.194 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)"
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 -p 9716 \
root@46.225.136.66 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)"
- name: Backup current test deployment
if: env.skip_deploy != '1'
run: |
ssh -i ~/.ssh/id_ed25519 haustest@188.245.242.194 \
ssh -i ~/.ssh/id_ed25519 -p 9716 root@46.225.136.66 \
"cd /home/haustest/htdocs && \
tar czf /home/haustest/backup-pre-deploy-\$(date +%Y%m%d-%H%M%S).tar.gz \
haus.test.kies-media.de && \
@@ -83,8 +83,16 @@ jobs:
--exclude='.stylelintrc.json' \
--exclude='.editorconfig' \
--exclude='.well-known' \
-e "ssh -i ~/.ssh/id_ed25519" \
./ haustest@188.245.242.194:/home/haustest/htdocs/haus.test.kies-media.de/
-e "ssh -i ~/.ssh/id_ed25519 -p 9716" \
./ root@46.225.136.66:/home/haustest/htdocs/haus.test.kies-media.de/
- name: Fix ownership and install dependencies
if: env.skip_deploy != '1'
run: |
ssh -i ~/.ssh/id_ed25519 -p 9716 root@46.225.136.66 \
"cd /home/haustest/htdocs/haus.test.kies-media.de && \
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --no-interaction --no-progress && \
chown -R haustest:haustest /home/haustest/htdocs/haus.test.kies-media.de"
- name: Smoke test
if: env.skip_deploy != '1'
@@ -129,6 +137,6 @@ jobs:
echo "- **Target:** https://haus.test.kies-media.de" >> $GITHUB_STEP_SUMMARY
echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Server:** haustest@188.245.242.194" >> $GITHUB_STEP_SUMMARY
echo "- **Server:** root@46.225.136.66:9716 (cp3)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Review URL:** https://haus.test.kies-media.de" >> $GITHUB_STEP_SUMMARY

View File

@@ -69,10 +69,6 @@ return [
'gallery.kid1' => 'Kinderzimmer 1 · 21,7 m²',
'gallery.kid2' => 'Kinderzimmer 2 · 15,7 m²',
'gallery.kid_detail' => 'Kinderzimmer Detail',
'gallery.kid_extra' => 'Kinderzimmer · Spielbereich',
'gallery.bath2' => 'Badezimmer · 6,4 m²',
'gallery.bath3' => 'Badezimmer · 5,8 m²',
'gallery.bath4' => 'Badezimmer · Wellness',
'gallery.guest' => 'Gästezimmer · 11,5 m²',
'gallery.area1' => 'Wohnbereich',
'gallery.area2' => 'Wohnbereich Detail',
@@ -84,11 +80,9 @@ return [
'gallery.alt.kid1' => 'Kinderzimmer 1 mit 21,7 m²',
'gallery.alt.kid2' => 'Kinderzimmer 2 mit 15,7 m²',
'gallery.alt.kid_detail' => 'Detailansicht Kinderzimmer',
'gallery.alt.kid_extra' => 'Spielbereich im Kinderzimmer',
'gallery.alt.guest' => 'Gästezimmer mit 11,5 m²',
'gallery.alt.bath2' => 'Zweites Badezimmer im Haus',
'gallery.alt.bath3' => 'Drittes Badezimmer im Haus',
'gallery.alt.bath4' => 'Viertes Badezimmer im Haus',
'gallery.alt.exterior' => 'Außenansicht des Einfamilienhauses',
// ─── Floor plans (Grundriss) ────────────────────────────────────────
@@ -126,10 +120,6 @@ return [
'floors.alt.og1' => 'Grundriss 1. Obergeschoss',
'floors.alt.og2' => 'Grundriss 2. Obergeschoss',
'floors.alt.attic' => 'Grundriss Dachboden',
'floors.alt.eg_3d' => '3D-Ansicht Erdgeschoss',
'floors.alt.og1_3d' => '3D-Ansicht 1. Obergeschoss',
'floors.alt.og2_3d' => '3D-Ansicht 2. Obergeschoss',
'floors.alt.attic_2' => 'Alternative Ansicht Dachboden',
// ─── Rent (Miete) ────────────────────────────────────────────────────
'rent.eyebrow' => 'Mietkonditionen',

View File

@@ -59,10 +59,6 @@ return [
'gallery.kid1' => 'Child\'s room 1 · 21.7 m²',
'gallery.kid2' => 'Child\'s room 2 · 15.7 m²',
'gallery.kid_detail' => 'Child\'s room detail',
'gallery.kid_extra' => 'Child\'s room · play area',
'gallery.bath2' => 'Bathroom · 6.4 m²',
'gallery.bath3' => 'Bathroom · 5.8 m²',
'gallery.bath4' => 'Bathroom · wellness',
'gallery.guest' => 'Guest room · 11.5 m²',
'gallery.area1' => 'Living area',
'gallery.area2' => 'Living area detail',
@@ -74,11 +70,9 @@ return [
'gallery.alt.kid1' => 'Child\'s room 1 with 21.7 m²',
'gallery.alt.kid2' => 'Child\'s room 2 with 15.7 m²',
'gallery.alt.kid_detail' => 'Child\'s room detail view',
'gallery.alt.kid_extra' => 'Play area in the child\'s room',
'gallery.alt.guest' => 'Guest room with 11.5 m²',
'gallery.alt.bath2' => 'Second bathroom in the house',
'gallery.alt.bath3' => 'Third bathroom in the house',
'gallery.alt.bath4' => 'Fourth bathroom in the house',
'gallery.alt.exterior' => 'Exterior view of the detached house',
'floors.eyebrow' => 'Layout',
@@ -115,10 +109,6 @@ return [
'floors.alt.og1' => 'Floor plan 1st upper floor',
'floors.alt.og2' => 'Floor plan 2nd upper floor',
'floors.alt.attic' => 'Floor plan attic',
'floors.alt.eg_3d' => '3D view ground floor',
'floors.alt.og1_3d' => '3D view 1st upper floor',
'floors.alt.og2_3d' => '3D view 2nd upper floor',
'floors.alt.attic_2' => 'Alternative view of the attic',
'rent.eyebrow' => 'Rental terms',
'rent.aria' => 'Rental terms',

View File

@@ -59,10 +59,6 @@ return [
'gallery.kid1' => 'Детская 1 · 21,7 м²',
'gallery.kid2' => 'Детская 2 · 15,7 м²',
'gallery.kid_detail' => 'Деталь детской',
'gallery.kid_extra' => 'Детская · игровая зона',
'gallery.bath2' => 'Ванная · 6,4 м²',
'gallery.bath3' => 'Ванная · 5,8 м²',
'gallery.bath4' => 'Ванная · велнес',
'gallery.guest' => 'Гостевая комната · 11,5 м²',
'gallery.area1' => 'Жилая зона',
'gallery.area2' => 'Деталь жилой зоны',
@@ -74,11 +70,9 @@ return [
'gallery.alt.kid1' => 'Детская комната 1 — 21,7 м²',
'gallery.alt.kid2' => 'Детская комната 2 — 15,7 м²',
'gallery.alt.kid_detail' => 'Детальный вид детской комнаты',
'gallery.alt.kid_extra' => 'Игровая зона в детской комнате',
'gallery.alt.guest' => 'Гостевая комната 11,5 м²',
'gallery.alt.bath2' => 'Вторая ванная комната в доме',
'gallery.alt.bath3' => 'Третья ванная комната в доме',
'gallery.alt.bath4' => 'Четвертая ванная комната в доме',
'gallery.alt.exterior' => 'Внешний вид частного дома',
'floors.eyebrow' => 'Планировка',
@@ -115,10 +109,6 @@ return [
'floors.alt.og1' => 'План второго этажа',
'floors.alt.og2' => 'План третьего этажа',
'floors.alt.attic' => 'План чердака',
'floors.alt.eg_3d' => '3D-вид первого этажа',
'floors.alt.og1_3d' => '3D-вид второго этажа',
'floors.alt.og2_3d' => '3D-вид третьего этажа',
'floors.alt.attic_2' => 'Альтернативный вид чердака',
'rent.eyebrow' => 'Условия аренды',
'rent.aria' => 'Условия аренды',

View File

@@ -59,10 +59,6 @@ return [
'gallery.kid1' => 'Дитяча кімната 1 · 21,7 м²',
'gallery.kid2' => 'Дитяча кімната 2 · 15,7 м²',
'gallery.kid_detail' => 'Деталь дитячої кімнати',
'gallery.kid_extra' => 'Дитяча кімната · ігрова зона',
'gallery.bath2' => 'Ванна кімната · 6,4 м²',
'gallery.bath3' => 'Ванна кімната · 5,8 м²',
'gallery.bath4' => 'Ванна кімната · велнес',
'gallery.guest' => 'Гостьова кімната · 11,5 м²',
'gallery.area1' => 'Житлова зона',
'gallery.area2' => 'Деталь житлової зони',
@@ -74,11 +70,9 @@ return [
'gallery.alt.kid1' => 'Дитяча кімната 1 — 21,7 м²',
'gallery.alt.kid2' => 'Дитяча кімната 2 — 15,7 м²',
'gallery.alt.kid_detail' => 'Детальний вигляд дитячої кімнати',
'gallery.alt.kid_extra' => 'Ігрова зона в дитячій кімнаті',
'gallery.alt.guest' => 'Гостьова кімната 11,5 м²',
'gallery.alt.bath2' => 'Друга ванна кімната в будинку',
'gallery.alt.bath3' => 'Третя ванна кімната в будинку',
'gallery.alt.bath4' => 'Четверта ванна кімната в будинку',
'gallery.alt.exterior' => 'Зовнішній вигляд приватного будинку',
'floors.eyebrow' => 'Планування',
@@ -115,10 +109,6 @@ return [
'floors.alt.og1' => 'План другого поверху',
'floors.alt.og2' => 'План третього поверху',
'floors.alt.attic' => 'План горища',
'floors.alt.eg_3d' => '3D-вигляд першого поверху',
'floors.alt.og1_3d' => '3D-вигляд другого поверху',
'floors.alt.og2_3d' => '3D-вигляд третього поверху',
'floors.alt.attic_2' => 'Альтернативний вигляд горища',
'rent.eyebrow' => 'Умови оренди',
'rent.aria' => 'Умови оренди',

View File

@@ -23,13 +23,9 @@ $gridItems = [
['img' => 'bilder/Küche 1.jpg', 'key' => 'gallery.kitchen', 'alt' => 'gallery.alt.kitchen', 'class' => ''],
['img' => 'bilder/schlafzimmer.png', 'key' => 'gallery.bedroom', 'alt' => 'gallery.alt.bedroom', 'class' => ''],
['img' => 'bilder/Bad.jpg', 'key' => 'gallery.bath', 'alt' => 'gallery.alt.bath', 'class' => ''],
['img' => 'bilder/Bad-2.jpeg', 'key' => 'gallery.bath2', 'alt' => 'gallery.alt.bath2', 'class' => ''],
['img' => 'bilder/Bad-3.jpeg', 'key' => 'gallery.bath3', 'alt' => 'gallery.alt.bath3', 'class' => ''],
['img' => 'bilder/Bad-4.jpeg', 'key' => 'gallery.bath4', 'alt' => 'gallery.alt.bath4', 'class' => ''],
['img' => 'bilder/Kinderzimmer 2.jpg', 'key' => 'gallery.kid1', 'alt' => 'gallery.alt.kid1', 'class' => ''],
['img' => 'bilder/Kinderzimmer 3.jpg', 'key' => 'gallery.kid2', 'alt' => 'gallery.alt.kid2', 'class' => ''],
['img' => 'bilder/kinderzimmer 2 2.webp', 'key' => 'gallery.kid_detail', 'alt' => 'gallery.alt.kid_detail', 'class' => 'span-2 row-1'],
['img' => 'bilder/Kinderzimmer.png', 'key' => 'gallery.kid_extra', 'alt' => 'gallery.alt.kid_extra', 'class' => ''],
['img' => 'bilder/Außenansicht-2.png', 'key' => 'gallery.area3', 'alt' => 'gallery.alt.exterior', 'class' => 'span-2 row-1'],
];
?>
@@ -86,7 +82,7 @@ $gridItems = [
</section>
<section class="gallery-section" id="galerie" aria-label="<?= htmlspecialchars($t('gallery.aria'), ENT_QUOTES) ?>">
<div class="section-head gallery-header">
<div class="section-head">
<span class="section-eyebrow"><?= htmlspecialchars($t('gallery.eyebrow'), ENT_QUOTES) ?></span>
<h2><?= htmlspecialchars($t('gallery.h2'), ENT_QUOTES) ?></h2>
</div>
@@ -116,13 +112,6 @@ $gridItems = [
'attic' => 'bilder/grundrisse/Dachboden unten.png',
];
$floorImageMapExtra = [
'eg' => ['img' => 'bilder/grundrisse/EG 3D.png', 'altKey' => 'floors.alt.eg_3d'],
'og1' => ['img' => 'bilder/grundrisse/OG 1 3D.png', 'altKey' => 'floors.alt.og1_3d'],
'og2' => ['img' => 'bilder/grundrisse/OG 2 3D.png', 'altKey' => 'floors.alt.og2_3d'],
'attic' => ['img' => 'bilder/grundrisse/Dachboden unten 2.png', 'altKey' => 'floors.alt.attic_2'],
];
$floors = [
['id' => 'eg', 'titleKey' => 'floors.eg.title', 'areaKey' => 'floors.eg.area', 'altKey' => 'floors.alt.eg',
'rooms' => [
@@ -164,26 +153,12 @@ $gridItems = [
<summary class="floor-header">
<span class="floor-title"><?= htmlspecialchars($t($floor['titleKey']), ENT_QUOTES) ?></span>
<span class="floor-area"><?= htmlspecialchars($t($floor['areaKey']), ENT_QUOTES) ?></span>
<span class="floor-icon" aria-hidden="true">+</span>
</summary>
<div class="floor-body">
<?php
$primaryImg = $floorImageMap[$floor['id']] ?? 'bilder/grundrisse/EG.png';
$extra = $floorImageMapExtra[$floor['id']] ?? null;
$wrapperCls = $extra ? 'floor-plan-multi' : 'floor-plan';
?>
<div class="<?= htmlspecialchars($wrapperCls, ENT_QUOTES) ?>">
<img src="/<?= htmlspecialchars($primaryImg, ENT_QUOTES) ?>"
<img src="/<?= htmlspecialchars($floorImageMap[$floor['id']] ?? 'bilder/grundrisse/EG.png', ENT_QUOTES) ?>"
alt="<?= htmlspecialchars($t($floor['altKey']), ENT_QUOTES) ?>"
loading="lazy" decoding="async"
class="floor-plan-img">
<?php if ($extra !== null): ?>
<img src="/<?= htmlspecialchars($extra['img'], ENT_QUOTES) ?>"
alt="<?= htmlspecialchars($t($extra['altKey']), ENT_QUOTES) ?>"
loading="lazy" decoding="async"
class="floor-plan-img">
<?php endif; ?>
</div>
<ul class="room-list">
<?php foreach ($floor['rooms'] as $room): ?>
<li>
@@ -262,7 +237,7 @@ $gridItems = [
<div class="lage-map-wrapper">
<iframe
title="<?= htmlspecialchars($t('loc.map_title'), ENT_QUOTES) ?>"
src="https://www.openstreetmap.org/export/embed.html?bbox=10.7424%2C50.5072%2C10.7524%2C50.5108&amp;layer=mapnik&amp;marker=50.5090%2C10.7474"
src="https://www.openstreetmap.org/export/embed.html?bbox=10.7535%2C50.5095%2C10.7705%2C50.5185&amp;layer=mapnik&amp;marker=50.5140%2C10.7620"
loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p class="lage-address">
<strong><?= htmlspecialchars($t('loc.address'), ENT_QUOTES) ?>:</strong><br>

View File

@@ -543,7 +543,7 @@ nav.scrolled {
}
.gallery-header {
padding: 5rem 1.5rem 3rem;
padding: 5rem 3rem 3rem;
max-width: 1400px;
margin: 0 auto;
}
@@ -747,8 +747,7 @@ nav.scrolled {
color: var(--stone);
}
.floor-plan,
.floor-plan-multi {
.floor-plan {
margin-top: 1.5rem;
border: 1px solid var(--warm);
background: var(--white);
@@ -756,6 +755,14 @@ nav.scrolled {
max-width: 100%;
}
.floor-plan img {
width: 100%;
max-width: 100%;
height: auto;
display: block;
object-fit: contain;
}
.floor-plan-multi {
display: grid;
grid-template-columns: 1fr 1fr;
@@ -763,9 +770,7 @@ nav.scrolled {
background: var(--warm);
}
.floor-plan img,
.floor-plan-multi img,
img.floor-plan-img {
.floor-plan-multi img {
width: 100%;
max-width: 100%;
height: auto;
@@ -774,42 +779,6 @@ img.floor-plan-img {
background: var(--white);
}
/* Room list — visible m² per floor */
.room-list {
list-style: none;
margin: 1.5rem 0 0;
padding: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 0.5rem;
}
.room-list li {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
padding: 0.75rem 1rem;
background: var(--cream);
font-size: 0.82rem;
color: var(--charcoal);
}
.room-name {
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.room-size {
flex: 0 0 auto;
font-size: 0.72rem;
color: var(--stone);
letter-spacing: 0.05em;
}
@media (width <= 768px) {
.floor-plan-multi {
grid-template-columns: 1fr;
@@ -820,6 +789,9 @@ img.floor-plan-img {
.pricing-section {
background: var(--dark);
padding: 6rem 3rem;
}
.pricing-inner {
max-width: 1200px;
margin: 0 auto;
}
@@ -1072,31 +1044,33 @@ img.floor-plan-img {
.contact-section {
background: var(--cream);
padding: 6rem 3rem;
max-width: 1200px;
margin: 0 auto;
}
.contact-section h2 {
.contact-inner {
max-width: 700px;
margin: 0 auto;
text-align: center;
}
.contact-inner h2 {
font-family: "Cormorant Garamond", serif;
font-size: clamp(2.2rem, 4vw, 3.5rem);
font-weight: 300;
line-height: 1.15;
color: var(--charcoal);
margin-bottom: 1rem;
text-align: center;
}
.contact-section h2 em {
.contact-inner h2 em {
font-style: italic;
color: var(--accent);
}
.contact-section p {
.contact-inner p {
font-size: 0.9rem;
color: var(--stone);
line-height: 1.8;
margin-bottom: 2.5rem;
text-align: center;
}
.contact-form {
@@ -1690,100 +1664,3 @@ nav:not(.scrolled) .locale-switcher__trigger:focus-visible {
outline: 2px solid #b91c1c;
outline-offset: 2px;
}
/* LEGAL PAGES (Impressum, Datenschutz) */
.legal-page {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 3rem;
color: var(--stone-strong);
line-height: 1.85;
}
.legal-page h1 {
font-family: "Cormorant Garamond", serif;
font-size: clamp(2.4rem, 4vw, 3.4rem);
font-weight: 300;
line-height: 1.1;
color: var(--charcoal);
margin: 0.5rem 0 2.5rem;
}
.legal-page h2 {
font-family: "DM Sans", sans-serif;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--charcoal);
margin: 2.5rem 0 1rem;
}
.legal-page h3 {
font-family: "DM Sans", sans-serif;
font-size: 0.95rem;
font-weight: 600;
color: var(--charcoal);
margin: 1.5rem 0 0.5rem;
}
.legal-page p,
.legal-page address,
.legal-page li {
font-size: 0.95rem;
line-height: 1.85;
color: var(--stone-strong);
font-style: normal;
}
.legal-page ul {
list-style: disc;
padding-left: 1.5rem;
margin: 0.5rem 0 1.25rem;
}
.legal-page ul li {
margin-bottom: 0.35rem;
}
.legal-page a {
color: var(--accent);
text-decoration: underline;
text-underline-offset: 0.2em;
text-decoration-thickness: 1px;
}
.legal-page a:hover {
color: var(--accent-light);
}
.legal-divider {
border: 0;
border-top: 1px solid var(--warm);
margin: 2rem 0;
}
.legal-back {
display: inline-block;
margin-top: 3rem;
font-family: "DM Sans", sans-serif;
font-size: 0.72rem;
font-weight: 600;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--accent);
text-decoration: none;
padding-bottom: 0.25rem;
border-bottom: 1px solid currentcolor;
transition: color 0.2s;
}
.legal-back:hover {
color: var(--accent-light);
}
@media (width <= 768px) {
.legal-page {
padding: 4rem 1.5rem;
}
}

View File

@@ -1,178 +0,0 @@
<?php
declare(strict_types=1);
namespace Tests\Views;
use PHPUnit\Framework\TestCase;
/**
* Regression test for issue #80: all house images in public/bilder/ must be
* referenced from the home view. Catches drift when new photos are added to
* disk but not yet wired into the gallery or floor-plan map.
*/
final class HomeGalleryInventoryTest extends TestCase
{
private const VIEW_PATH = __DIR__ . '/../../app/views/home/index.php';
private const BILDER_DIR = __DIR__ . '/../../public/bilder';
/** @var list<string> Files that may exist on disk but are intentionally NOT shown on the page. */
private const ALLOWED_UNUSED = [
// Hero / page background uses a .webp variant; the .png in bilder/ is the
// gallery source. Hero-bg is referenced separately in the <header>.
'favicon/',
// -small.* variants are served as thumb hints by JS lazy-load optimization.
'*-small.*',
];
public function testAllBilderFilesAreReferencedInHomeView(): void
{
$view = file_get_contents(self::VIEW_PATH);
self::assertNotFalse($view, 'Could not read home view');
$diskFiles = $this->listBilderFiles();
self::assertNotEmpty($diskFiles, 'No files found in public/bilder/');
// Group files by base name (filename without extension) so the
// .jpg/.png/.jpeg source + auto-generated .webp variant count as ONE image.
$groups = [];
foreach ($diskFiles as $relPath) {
if ($this->isAllowedUnused($relPath)) {
continue;
}
$groups[$this->baseOf($relPath)][] = $relPath;
}
$missing = [];
foreach ($groups as $base => $variants) {
$hit = false;
foreach ($variants as $v) {
// View may reference raw or with leading slash.
if (str_contains($view, $v) || str_contains($view, '/' . ltrim($v, '/'))) {
$hit = true;
break;
}
}
if (!$hit) {
$missing[] = $base . ' (' . implode(', ', $variants) . ')';
}
}
self::assertSame(
[],
$missing,
sprintf(
"These image groups exist in public/bilder/ but are NOT referenced anywhere in the home view:\n - %s\n\nFix: add them to \$gridItems (gallery) or \$floorImageMap / \$floorImageMapExtra (floor plans), and add the matching Locale keys.",
implode("\n - ", $missing),
)
);
}
public function testGalleryContainsAllRequiredImages(): void
{
$view = file_get_contents(self::VIEW_PATH);
self::assertNotFalse($view, 'Could not read home view');
$required = [
// Bathrooms (3 new ones in addition to the existing Bad.jpg)
'bilder/Bad.jpg',
'bilder/Bad-2.jpeg',
'bilder/Bad-3.jpeg',
'bilder/Bad-4.jpeg',
// Kids room extras
'bilder/Kinderzimmer.png',
// Floor plans 2D
'bilder/grundrisse/EG.png',
'bilder/grundrisse/OG 1 2.png',
'bilder/grundrisse/OG 2 grundriss.png',
'bilder/grundrisse/Dachboden unten.png',
// Floor plans 3D / alternate
'bilder/grundrisse/EG 3D.png',
'bilder/grundrisse/OG 1 3D.png',
'bilder/grundrisse/OG 2 3D.png',
'bilder/grundrisse/Dachboden unten 2.png',
];
$missing = array_values(array_filter($required, static fn (string $img) => !str_contains($view, $img)));
self::assertSame(
[],
$missing,
sprintf(
"Required images missing from home view:\n - %s",
implode("\n - ", $missing),
)
);
}
public function testFloorPlanMapsCoverAllFloors(): void
{
$view = file_get_contents(self::VIEW_PATH);
self::assertNotFalse($view, 'Could not read home view');
// Each floor in the $floors array must have an entry in BOTH maps
// (primary 2D + extra 3D/alternate) so the floor body renders both.
foreach (['eg', 'og1', 'og2', 'attic'] as $floorId) {
self::assertStringContainsString(
"'{$floorId}'",
$view,
"Floor '{$floorId}' not declared in home view",
);
}
}
/**
* @return list<string> relative paths (forward-slash, e.g. "grundrisse/EG.png")
*/
private function listBilderFiles(): array
{
$files = [];
$iter = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator(self::BILDER_DIR, \FilesystemIterator::SKIP_DOTS),
);
foreach ($iter as $file) {
if (!$file->isFile()) {
continue;
}
$rel = substr($file->getPathname(), strlen(self::BILDER_DIR) + 1);
$rel = str_replace(DIRECTORY_SEPARATOR, '/', $rel);
$files[] = $rel;
}
sort($files);
return $files;
}
private function isAllowedUnused(string $relPath): bool
{
foreach (self::ALLOWED_UNUSED as $pattern) {
if (str_ends_with($pattern, '/')) {
// Directory prefix
if (str_starts_with($relPath, $pattern)) {
return true;
}
} else {
// Glob-style match (only `*` supported, for `-small.*` variants)
$regex = '#^' . str_replace('\\*', '.*', preg_quote($pattern, '#')) . '$#';
if (preg_match($regex, $relPath) === 1) {
return true;
}
}
}
return false;
}
/**
* Base name = path minus extension. So "grundrisse/EG 3D.png" → "grundrisse/EG 3D",
* and "Küche 1.jpg" → "Küche 1". Used to group source + auto-generated variants.
*/
private function baseOf(string $relPath): string
{
$dot = strrpos($relPath, '.');
if ($dot === false || $dot === 0) {
return $relPath;
}
return substr($relPath, 0, $dot);
}
}