mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #9315 from creative-commoners/pulls/4/fix-alt-text-in-tests
FIX Adjust HTMLEditorField tests to support alt attr changes in assets
This commit is contained in:
commit
eef1e2b6a2
@ -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…
x
Reference in New Issue
Block a user