mirror of
https://github.com/silverstripe/silverstripe-versionfeed
synced 2024-10-22 11:05:31 +02:00
FIX: Don't caused HTML tidying to make an unreliable test
This commit is contained in:
parent
55fe8eb050
commit
4946376793
@ -32,15 +32,20 @@ class VersionFeedTest extends SapphireTest {
|
|||||||
$page->Title = 'My Unpublished Changed Title';
|
$page->Title = 'My Unpublished Changed Title';
|
||||||
$page->write();
|
$page->write();
|
||||||
|
|
||||||
|
// Strip spaces from test output because they're not reliably maintained by the HTML Tidier
|
||||||
|
$cleanDiffOutput = function($val) {
|
||||||
|
return str_replace(' ','',strip_tags($val));
|
||||||
|
};
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Changed Title',
|
str_replace(' ' ,'',_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Changed Title'),
|
||||||
array_map('strip_tags', $page->getDiffedChanges()->column('DiffTitle')),
|
array_map($cleanDiffOutput, $page->getDiffedChanges()->column('DiffTitle')),
|
||||||
'Detects published title changes'
|
'Detects published title changes'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertNotContains(
|
$this->assertNotContains(
|
||||||
_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Unpublished Changed Title',
|
str_replace(' ' ,'',_t('RSSHistory.TITLECHANGED', 'Title has changed:') . 'My Unpublished Changed Title'),
|
||||||
array_map('strip_tags', $page->getDiffedChanges()->column('DiffTitle')),
|
array_map($cleanDiffOutput, $page->getDiffedChanges()->column('DiffTitle')),
|
||||||
'Ignores unpublished title changes'
|
'Ignores unpublished title changes'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user