mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Adjust HTMLEditorField tests to support alt attr changes in assets
The default behaviour of the alt attribute has changed from using the filename to applying an empty value.
This commit is contained in:
parent
559f660e0e
commit
ea2a2b4786
@ -122,9 +122,9 @@ class HTMLEditorFieldTest extends FunctionalTest
|
||||
$parser = new CSSContentParser($obj->dbObject('Content')->forTemplate());
|
||||
$xml = $parser->getByXpath('//img');
|
||||
$this->assertEquals(
|
||||
'example',
|
||||
'',
|
||||
(string)$xml[0]['alt'],
|
||||
'Alt tags are added by default based on filename'
|
||||
'Alt attribute is always present, even if empty'
|
||||
);
|
||||
$this->assertEquals('', (string)$xml[0]['title'], 'Title tags are added by default.');
|
||||
$this->assertEquals(10, (int)$xml[0]['width'], 'Width tag of resized image is set.');
|
||||
@ -180,7 +180,7 @@ class HTMLEditorFieldTest extends FunctionalTest
|
||||
$this->assertEquals(
|
||||
<<<EOS
|
||||
<span class="readonly typography" id="Content">
|
||||
<img src="/assets/HTMLEditorFieldTest/f5c7c2f814/example__ResizedImageWzEwLDIwXQ.jpg" alt="example" width="10" height="20">
|
||||
<img src="/assets/HTMLEditorFieldTest/f5c7c2f814/example__ResizedImageWzEwLDIwXQ.jpg" alt="" width="10" height="20">
|
||||
</span>
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ EOS
|
||||
$this->assertEquals(
|
||||
<<<EOS
|
||||
<span class="readonly typography" id="Content">
|
||||
<img src="/assets/HTMLEditorFieldTest/f5c7c2f814/example__ResizedImageWzEwLDIwXQ.jpg" alt="example" width="10" height="20">
|
||||
<img src="/assets/HTMLEditorFieldTest/f5c7c2f814/example__ResizedImageWzEwLDIwXQ.jpg" alt="" width="10" height="20">
|
||||
</span>
|
||||
|
||||
<input type="hidden" name="Content" value="[image src="/assets/HTMLEditorFieldTest/f5c7c2f814/example.jpg" width="10" height="20" id="{$fileID}"]" />
|
||||
|
Loading…
Reference in New Issue
Block a user