mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Fixing broken SiteTreeHTMLEditorFieldTest
This commit is contained in:
parent
90a154c888
commit
2c4ebd3cb9
@ -53,16 +53,18 @@ class SiteTreeHtmlEditorFieldTest extends FunctionalTest {
|
||||
$editor->setValue('<img src="assets/example.jpg" />');
|
||||
$editor->saveInto($sitetree);
|
||||
|
||||
$xml = new SimpleXMLElement($sitetree->Content);
|
||||
$this->assertNotNull($xml['alt'], 'Alt tags are added by default.');
|
||||
$this->assertNotNull($xml['title'], 'Title tags are added by default.');
|
||||
$parser = new CSSContentParser($sitetree->Content);
|
||||
$xml = $parser->getByXpath('//img');
|
||||
$this->assertEquals('', $xml[0]['alt'], 'Alt tags are added by default.');
|
||||
$this->assertEquals('', $xml[0]['title'], 'Title tags are added by default.');
|
||||
|
||||
$editor->setValue('<img src="assets/example.jpg" alt="foo" title="bar" />');
|
||||
$editor->saveInto($sitetree);
|
||||
|
||||
$xml = new SimpleXMLElement($sitetree->Content);
|
||||
$this->assertNotNull('foo', $xml['alt'], 'Alt tags are preserved.');
|
||||
$this->assertNotNull('bar', $xml['title'], 'Title tags are preserved.');
|
||||
$parser = new CSSContentParser($sitetree->Content);
|
||||
$xml = $parser->getByXpath('//img');
|
||||
$this->assertEquals('foo', $xml[0]['alt'], 'Alt tags are preserved.');
|
||||
$this->assertEquals('bar', $xml[0]['title'], 'Title tags are preserved.');
|
||||
}
|
||||
|
||||
public function testImageTracking() {
|
||||
|
Loading…
Reference in New Issue
Block a user