Esempio n. 1
0
 public function testNodeConfig()
 {
     $user = '******';
     $c = Kwf_Component_Data_Root::getInstance();
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertFalse($cfg['actions']['add']);
     $this->assertFalse($cfg['allowDrop']);
     $this->assertFalse($cfg['actions']['delete']);
     $this->assertFalse($cfg['actions']['makeHome']);
     $this->assertFalse($cfg['allowDrag']);
     $c = Kwf_Component_Data_Root::getInstance()->getComponentById('root-main');
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertFalse($cfg['actions']['delete']);
     $this->assertFalse($cfg['actions']['makeHome']);
     $this->assertTrue($cfg['actions']['add']);
     $this->assertTrue($cfg['allowDrop']);
     $this->assertFalse($cfg['allowDrag']);
     $c = Kwf_Component_Data_Root::getInstance()->getComponentById('1');
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertTrue($cfg['actions']['delete']);
     $this->assertTrue($cfg['actions']['makeHome']);
     $this->assertTrue($cfg['actions']['add']);
     $this->assertTrue($cfg['allowDrop']);
     $this->assertTrue($cfg['allowDrag']);
     $c = Kwf_Component_Data_Root::getInstance()->getComponentById('3');
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertTrue($cfg['actions']['delete']);
     $this->assertTrue($cfg['actions']['makeHome']);
     $this->assertTrue($cfg['actions']['add']);
     $this->assertTrue($cfg['allowDrop']);
     $this->assertTrue($cfg['allowDrag']);
 }
Esempio n. 2
0
 public function testSpecialWithoutEditIsHidden()
 {
     $user = '******';
     $c = Kwf_Component_Data_Root::getInstance()->getComponentById('6');
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertNull($cfg);
     $c = Kwf_Component_Data_Root::getInstance()->getComponentById('7');
     $cfg = Kwf_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
     $this->assertNull($cfg);
 }