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"
# 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 fill in "Meta Description" with "MyMetaDesc"

View File

@ -2030,10 +2030,20 @@ class SiteTreeTest extends SapphireTest
*/
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->ExtraMeta = $extraMeta;
$siteTree->write();
$this->assertSame($expected, $siteTree->ExtraMeta, $message);
if (!$isDodgyAndUsingHTML5) {
$this->assertSame($expected, $siteTree->ExtraMeta, $message);
}
}
public function provideSanitiseExtraMeta(): array