mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #274 from creative-commoners/pulls/3.1/i-de-test-those-labels
FIX Correcting inconsistent capitalisation of label and cleaning up tests
This commit is contained in:
commit
0535d29f8d
@ -74,7 +74,7 @@ en:
|
|||||||
EMAIL: Email
|
EMAIL: Email
|
||||||
ISSPAM: 'Spam?'
|
ISSPAM: 'Spam?'
|
||||||
MODERATED: 'Moderated?'
|
MODERATED: 'Moderated?'
|
||||||
NAME: 'Author Name'
|
NAME: 'Author name'
|
||||||
'ON': 'on'
|
'ON': 'on'
|
||||||
OPTIONS: Options
|
OPTIONS: Options
|
||||||
OPTION_DESCRIPTION: 'Unmoderated and spam comments will not be displayed until approved'
|
OPTION_DESCRIPTION: 'Unmoderated and spam comments will not be displayed until approved'
|
||||||
|
@ -219,7 +219,7 @@ class Comment extends DataObject
|
|||||||
{
|
{
|
||||||
$labels = parent::fieldLabels($includerelations);
|
$labels = parent::fieldLabels($includerelations);
|
||||||
|
|
||||||
$labels['Name'] = _t(__CLASS__ . '.NAME', 'Author Name');
|
$labels['Name'] = _t(__CLASS__ . '.NAME', 'Author name');
|
||||||
$labels['Comment'] = _t(__CLASS__ . '.COMMENT', 'Comment');
|
$labels['Comment'] = _t(__CLASS__ . '.COMMENT', 'Comment');
|
||||||
$labels['Email'] = _t(__CLASS__ . '.EMAIL', 'Email');
|
$labels['Email'] = _t(__CLASS__ . '.EMAIL', 'Email');
|
||||||
$labels['URL'] = _t(__CLASS__ . '.URL', 'URL');
|
$labels['URL'] = _t(__CLASS__ . '.URL', 'URL');
|
||||||
|
@ -605,52 +605,19 @@ class CommentsTest extends FunctionalTest
|
|||||||
*/
|
*/
|
||||||
public function testFieldLabels()
|
public function testFieldLabels()
|
||||||
{
|
{
|
||||||
$locale = i18n::get_locale();
|
|
||||||
i18n::set_locale('fr');
|
|
||||||
|
|
||||||
/** @var Comment $comment */
|
/** @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' => 'Author name',
|
||||||
'Comment' => 'Commentaire',
|
|
||||||
'Email' => 'Email',
|
|
||||||
'URL' => 'URL',
|
|
||||||
'Moderated' => 'Modéré?',
|
|
||||||
'IsSpam' => 'Spam?',
|
|
||||||
'AllowHtml' => 'Allow Html',
|
|
||||||
'SecretToken' => 'Secret Token',
|
|
||||||
'Depth' => 'Depth',
|
|
||||||
'Author' => 'Author Member',
|
|
||||||
'ParentComment' => 'Parent Comment',
|
|
||||||
'ChildComments' => 'Child Comments',
|
|
||||||
'ParentTitle' => 'Parent',
|
|
||||||
'Created' => 'Date de publication',
|
|
||||||
'Parent' => 'Parent'
|
|
||||||
);
|
|
||||||
i18n::set_locale($locale);
|
|
||||||
foreach ($expected as $key => $value) {
|
|
||||||
$this->assertEquals($value, $labels[$key]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$labels = $comment->FieldLabels();
|
|
||||||
$expected = array(
|
|
||||||
'Name' => 'Author Name',
|
|
||||||
'Comment' => 'Comment',
|
'Comment' => 'Comment',
|
||||||
'Email' => 'Email',
|
'Email' => 'Email',
|
||||||
'URL' => 'URL',
|
'URL' => 'URL',
|
||||||
'Moderated' => 'Moderated?',
|
|
||||||
'IsSpam' => 'Spam?',
|
'IsSpam' => 'Spam?',
|
||||||
'AllowHtml' => 'Allow Html',
|
'Moderated' => 'Moderated?',
|
||||||
'SecretToken' => 'Secret Token',
|
|
||||||
'Depth' => 'Depth',
|
|
||||||
'Author' => 'Author Member',
|
|
||||||
'ParentComment' => 'Parent Comment',
|
|
||||||
'ChildComments' => 'Child Comments',
|
|
||||||
'ParentTitle' => 'Parent',
|
'ParentTitle' => 'Parent',
|
||||||
'Created' => 'Date posted',
|
'Created' => 'Date posted',
|
||||||
'Parent' => 'Parent'
|
|
||||||
);
|
);
|
||||||
foreach ($expected as $key => $value) {
|
foreach ($expected as $key => $value) {
|
||||||
$this->assertEquals($value, $labels[$key]);
|
$this->assertEquals($value, $labels[$key]);
|
||||||
|
Loading…
Reference in New Issue
Block a user