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:
Serge Latyntsev 2019-11-15 08:24:22 +13:00 committed by GitHub
commit eef1e2b6a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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=&quot;/assets/HTMLEditorFieldTest/f5c7c2f814/example.jpg&quot; width=&quot;10&quot; height=&quot;20&quot; id=&quot;{$fileID}&quot;]" />