function setUp()
 {
     $perms = new Perms();
     $perms->setResolverFactories(array(new Perms_ResolverFactory_StaticFactory('static', new Perms_Resolver_Static(array('Admins' => array('admin_wiki'))))));
     $perms->setGroups(array('Admins'));
     $perms->setCheckSequence(array(new Perms_Check_Direct(), $this->mockA = $this->getMock('Perms_Check'), $this->mockB = $this->getMock('Perms_Check')));
     Perms::set($perms);
 }
示例#2
0
文件: BaseTest.php 项目: rjsmelo/tiki
 function testGroupsPropagateToAccessor()
 {
     $perms = new Perms();
     $perms->setGroups(array('Registered', 'Administrator'));
     Perms::set($perms);
     $expect = new Perms_Accessor();
     $expect->setGroups(array('Registered', 'Administrator'));
     $this->assertEquals($expect, Perms::get());
 }