mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge branch '4.12' into 4
This commit is contained in:
commit
9269356ae9
@ -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"
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user