/', $s); $iOpen = strpos($s, ''); $this->assertNotFalse($iCover); $this->assertNotFalse($iContent); $this->assertTrue($iOpen < $iCover && $iCover < $iContent && $iContent < $iClose, '
opens before the cover and closes after the content.'); $this->assertMatchesRegularExpression('/' . preg_quote($sBeforeClose, '/') . '\n\s*<\/main>/', $s, '
closes right after the content wrapper.'); $this->assertDoesNotMatchRegularExpression('/.'); } public static function partials(): array { return array_map(fn($s) => [$s], ['template/_page_content_beg.html', 'template/_page_content_end.html', 'template/page_54.html', 'template/page_56.html', 'template/page_58.html']); } #[\PHPUnit\Framework\Attributes\DataProvider('partials')] public function testHtmxPartialsOpenNoMain(string $sPath): void { $s = self::read($sPath); $this->assertDoesNotMatchRegularExpression('/<\/?main\b/', $s, 'The partial is swapped inside the shell\'s
.'); $this->assertStringNotContainsString('id="bx-content-main"', $s); } public function testMainKeepsTheFooterAtTheBottomInThemeShells(): void { $s = self::read('template/css/general.css'); $this->assertMatchesRegularExpression('/#bx-content-wrapper \{[^}]*flex-grow: 3;/', $s); $this->assertMatchesRegularExpression('/#bx-content-main:has\(> #bx-content-wrapper\) \{[^}]*flex-grow: 3;/', $s, '
took #bx-content-wrapper\'s place as the flex item.'); } }