silverstripe-comments/tests/CommentAdminTest.php

42 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace SilverStripe\Comments\Tests;
use SilverStripe\Comments\Admin\CommentAdmin;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\i18n\i18n;
2017-09-18 04:16:24 +02:00
use SilverStripe\Security\Security;
2016-02-19 01:48:25 +01:00
class CommentAdminTest extends SapphireTest
{
/**
* {@inheritDoc}
*/
protected $usesDatabase = true;
2016-02-19 01:48:25 +01:00
public function testProvidePermissions()
{
$commentAdmin = new CommentAdmin();
$locale = i18n::get_locale();
i18n::set_locale('fr');
$expected = array(
'CMS_ACCESS_CommentAdmin' => array(
2017-09-18 04:16:24 +02:00
'name' => 'Accès à la section Commentaires',
'category' => 'CMS Access' // missing in core
)
);
2017-09-18 04:16:24 +02:00
$this->assertEquals($expected, $commentAdmin->providePermissions());
i18n::set_locale($locale);
$expected = array(
'CMS_ACCESS_CommentAdmin' => array(
'name' => 'Access to \'Comments\' section',
'category' => 'CMS Access'
)
);
$this->assertEquals($expected, $commentAdmin->providePermissions());
2016-02-19 01:48:25 +01:00
}
}