26 lines
1.3 KiB
PHP
26 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* Begrenzte Flächen (Hintergrundbreite „Auf Abschnittsbreite begrenzt“) verschmelzen, wenn „Abstand unten“ und
|
|
* „Abstand oben“ der Nachbarn „kein Abstand“ sind. Das Verhalten ist reines CSS; geprüft wird die Regel für jede Fläche,
|
|
* die der Renderer als eigene Fläche kennt, damit eine neue Fläche die Naht nicht vergisst.
|
|
*/
|
|
class CmsSectionMergeTest extends TestCase
|
|
{
|
|
public function test_the_merge_rules_cover_every_surface_and_both_sides_of_the_seam(): void
|
|
{
|
|
$css = (string) file_get_contents(resource_path('css/sections.css'));
|
|
|
|
foreach (['light', 'dark', 'accent', 'palette', 'image'] as $surface) {
|
|
$this->assertStringContainsString('.section-bg-'.$surface, $css, 'Die Fläche „'.$surface.'“ fehlt in den Regeln.');
|
|
}
|
|
|
|
$this->assertMatchesRegularExpression('/\.section-bg-width-section\.section-space-bottom-none:has\(\+ :is\([^)]*\)\.section-space-top-none\)\s*\{[^}]*margin-bottom:\s*0;/', $css, 'Unterseite der oberen Fläche');
|
|
$this->assertMatchesRegularExpression('/\.section-space-bottom-none \+ \.section-bg-width-section\.section-space-top-none\s*\{[^}]*margin-top:\s*0;/', $css, 'Oberseite der unteren Fläche');
|
|
}
|
|
}
|