Merge branch '4.12' into 4

This commit is contained in:
Steve Boyd 2023-02-02 16:09:14 +13:00
commit 9269356ae9
2 changed files with 12 additions and 2 deletions

View File

@ -54,7 +54,7 @@ Feature: Edit a page
Then the rendered HTML should contain "/about-modified-us" Then the rendered HTML should contain "/about-modified-us"
# Add metadata # Add metadata
When I click on the "#ui-accordion-Form_EditForm_Metadata-header-0" element When I click on the ".ui-accordion-header" element
And I wait for 1 second And I wait for 1 second
And I fill in "Meta Description" with "MyMetaDesc" And I fill in "Meta Description" with "MyMetaDesc"

View File

@ -2030,11 +2030,21 @@ class SiteTreeTest extends SapphireTest
*/ */
public function testSanitiseExtraMeta(string $extraMeta, string $expected, string $message): void public function testSanitiseExtraMeta(string $extraMeta, string $expected, string $message): void
{ {
// If using HTML5Value then the 'somethingdodgy' test won't be converted to valid html
// However if using the default HTMLValue, then it will be converted to valid html
$isDodgyAndUsingHTML5 = strpos($expected, 'somethingdodgy') !== false &&
(HTMLValue::create() instanceof HTML5Value);
if ($isDodgyAndUsingHTML5) {
$this->expectException(ValidationException::class);
$this->expectExceptionMessage('Custom Meta Tags does not contain valid HTML');
}
$siteTree = new SiteTree(); $siteTree = new SiteTree();
$siteTree->ExtraMeta = $extraMeta; $siteTree->ExtraMeta = $extraMeta;
$siteTree->write(); $siteTree->write();
if (!$isDodgyAndUsingHTML5) {
$this->assertSame($expected, $siteTree->ExtraMeta, $message); $this->assertSame($expected, $siteTree->ExtraMeta, $message);
} }
}
public function provideSanitiseExtraMeta(): array public function provideSanitiseExtraMeta(): array
{ {