mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
String casting in SimpleXML tests for older phpunit versions
This commit is contained in:
parent
83febeff12
commit
894d48789c
@ -53,18 +53,18 @@ class SiteTreeHtmlEditorFieldTest extends FunctionalTest {
|
||||
$editor->setValue('<img src="assets/example.jpg" />');
|
||||
$editor->saveInto($sitetree);
|
||||
|
||||
$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.');
|
||||
$parser = new CSSContentParser($sitetree->Content);
|
||||
$xml = $parser->getByXpath('//img');
|
||||
$this->assertEquals('', (string)$xml[0]['alt'], 'Alt tags are added by default.');
|
||||
$this->assertEquals('', (string)$xml[0]['title'], 'Title tags are added by default.');
|
||||
|
||||
$editor->setValue('<img src="assets/example.jpg" alt="foo" title="bar" />');
|
||||
$editor->saveInto($sitetree);
|
||||
$editor->setValue('<img src="assets/example.jpg" alt="foo" title="bar" />');
|
||||
$editor->saveInto($sitetree);
|
||||
|
||||
$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.');
|
||||
$parser = new CSSContentParser($sitetree->Content);
|
||||
$xml = $parser->getByXpath('//img');
|
||||
$this->assertEquals('foo', (string)$xml[0]['alt'], 'Alt tags are preserved.');
|
||||
$this->assertEquals('bar', (string)$xml[0]['title'], 'Title tags are preserved.');
|
||||
}
|
||||
|
||||
public function testImageTracking() {
|
||||
|
Loading…
Reference in New Issue
Block a user