silverstripe-framework/tests/security/PermissionCheckboxSetFieldTest.php
Ingo Schommer 4452101790 API CHANGE Refactored hiding of Permissions added in r92428. Added PermissionCheckboxSetField?->setHiddenPermissions() (from r92865)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@92878 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:17:38 +13:00

24 lines
555 B
PHP

<?php
/**
* @package sapphire
* @subpackage tests
*/
class PermissionCheckboxSetFieldTest extends SapphireTest {
function testHiddenPermissions() {
$f = new PermissionCheckboxSetField(
'Permissions',
'Permissions',
'Permission',
'GroupID'
);
$f->setHiddenPermissions(
array('CMS_ACCESS_ReportAdmin')
);
$this->assertEquals(
$f->getHiddenPermissions(),
array('CMS_ACCESS_ReportAdmin')
);
$this->assertContains('CMS_ACCESS_CMSMain', $f->Field());
$this->assertNotContains('CMS_ACCESS_ReportAdmin', $f->Field());
}
}