MINOR: Added a test case for saving links without a href attribute in HtmlEditorField.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88800 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew Short 2009-10-13 02:44:10 +00:00 committed by Sam Minnee
parent 2be58d19f3
commit 360dd5ebd9

View File

@ -120,4 +120,16 @@ class HtmlEditorFieldTest extends FunctionalTest {
$this->assertEquals("<p>First Paragraph</p>\n\n<p>Second Paragraph</p>", $sitetree->Content);
}
public function testSavingLinksWithoutHref() {
$sitetree = $this->objFromFixture('SiteTree', 'home');
$editor = new HtmlEditorField('Content');
$editor->setValue('<p><a name="example-anchor"></a></p>');
$editor->saveInto($sitetree);
$this->assertEquals (
'<p><a name="example-anchor"/></p>', $sitetree->Content, 'Saving a link without a href attribute works'
);
}
}