mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
FIX Allow tests to handle extra field labels being added in global state
This commit is contained in:
parent
06acad661f
commit
eca3ac0e94
@ -607,7 +607,10 @@ class CommentsTest extends FunctionalTest
|
|||||||
{
|
{
|
||||||
$locale = i18n::get_locale();
|
$locale = i18n::get_locale();
|
||||||
i18n::set_locale('fr');
|
i18n::set_locale('fr');
|
||||||
|
|
||||||
|
/** @var Comment $comment */
|
||||||
$comment = $this->objFromFixture(Comment::class, 'firstComA');
|
$comment = $this->objFromFixture(Comment::class, 'firstComA');
|
||||||
|
|
||||||
$labels = $comment->FieldLabels();
|
$labels = $comment->FieldLabels();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'Name' => 'Nom de l\'Auteur',
|
'Name' => 'Nom de l\'Auteur',
|
||||||
@ -627,7 +630,10 @@ class CommentsTest extends FunctionalTest
|
|||||||
'Parent' => 'Parent'
|
'Parent' => 'Parent'
|
||||||
);
|
);
|
||||||
i18n::set_locale($locale);
|
i18n::set_locale($locale);
|
||||||
$this->assertEquals($expected, $labels);
|
foreach ($expected as $key => $value) {
|
||||||
|
$this->assertEquals($value, $labels[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
$labels = $comment->FieldLabels();
|
$labels = $comment->FieldLabels();
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'Name' => 'Author Name',
|
'Name' => 'Author Name',
|
||||||
@ -646,7 +652,9 @@ class CommentsTest extends FunctionalTest
|
|||||||
'Created' => 'Date posted',
|
'Created' => 'Date posted',
|
||||||
'Parent' => 'Parent'
|
'Parent' => 'Parent'
|
||||||
);
|
);
|
||||||
$this->assertEquals($expected, $labels);
|
foreach ($expected as $key => $value) {
|
||||||
|
$this->assertEquals($value, $labels[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetParent()
|
public function testGetParent()
|
||||||
|
Loading…
Reference in New Issue
Block a user