MDL-61836 blog: Fix random order failures

This commit is contained in:
Andrew Nicols 2018-04-20 08:49:00 +08:00
parent 0288333c0b
commit 7072009431

View File

@ -594,8 +594,17 @@ class core_blog_privacy_testcase extends provider_testcase {
$comments = $writer->get_data($commentpath);
$this->assertCount(2, $comments->comments);
$this->assertEquals('Hello, it\'s me!', strip_tags($comments->comments[0]->content));
$this->assertEquals('I was wondering if after', strip_tags($comments->comments[1]->content));
$c0 = strip_tags($comments->comments[0]->content);
$c1 = strip_tags($comments->comments[1]->content);
$expectedcomments = [
'Hello, it\'s me!',
'I was wondering if after',
];
$this->assertNotFalse(array_search($c0, $expectedcomments));
$this->assertNotFalse(array_search($c1, $expectedcomments));
$this->assertNotEquals($c0, $c1);
} else {
$tagdata = $writer->get_related_data($path, 'tags');