<commit_before><?php
/**
 * @group PagesController
 */
class Vps_Component_PagesController_WithCategories_Test extends Vpc_TestAbstract
{
    private $_acl;
    public function setUp()
    {
        parent::setUp('Vps_Component_PagesController_WithCategories_Root');
        $acl = new Vps_Acl();
        $this->_acl = $acl->getComponentAcl();
        $acl->addRole(new Zend_Acl_Role('test'));
        $this->_acl->allowComponent('test', null);
    }

    public function testNodeConfig()
    {
        $user = 'test';
        $c = Vps_Component_Data_Root::getInstance();
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertFalse($cfg['actions']['add']);
        $this->assertFalse($cfg['allowDrop']);
        $this->assertFalse($cfg['actions']['properties']);
        $this->assertFalse($cfg['actions']['delete']);
        $this->assertFalse($cfg['actions']['makeHome']);
        $this->assertFalse($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('root-main');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertFalse($cfg['actions']['properties']);
        $this->assertFalse($cfg['actions']['delete']);
        $this->assertFalse($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertFalse($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('1');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertTrue($cfg['actions']['properties']);
        $this->assertTrue($cfg['actions']['delete']);
        $this->assertTrue($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertTrue($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('3');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertTrue($cfg['actions']['properties']);
        $this->assertTrue($cfg['actions']['delete']);
        $this->assertTrue($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertTrue($cfg['allowDrag']);
    }


    //TODO spezielle acl berechtigungen
    //TODO editComponents (boxen usw)
}<commit_msg>kommentare entfernt, das wird eh schon beim anderen test getestet<commit_after><?php
/**
 * @group PagesController
 */
class Vps_Component_PagesController_WithCategories_Test extends Vpc_TestAbstract
{
    private $_acl;
    public function setUp()
    {
        parent::setUp('Vps_Component_PagesController_WithCategories_Root');
        $acl = new Vps_Acl();
        $this->_acl = $acl->getComponentAcl();
        $acl->addRole(new Zend_Acl_Role('test'));
        $this->_acl->allowComponent('test', null);
    }

    public function testNodeConfig()
    {
        $user = 'test';
        $c = Vps_Component_Data_Root::getInstance();
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertFalse($cfg['actions']['add']);
        $this->assertFalse($cfg['allowDrop']);
        $this->assertFalse($cfg['actions']['properties']);
        $this->assertFalse($cfg['actions']['delete']);
        $this->assertFalse($cfg['actions']['makeHome']);
        $this->assertFalse($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('root-main');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertFalse($cfg['actions']['properties']);
        $this->assertFalse($cfg['actions']['delete']);
        $this->assertFalse($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertFalse($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('1');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertTrue($cfg['actions']['properties']);
        $this->assertTrue($cfg['actions']['delete']);
        $this->assertTrue($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertTrue($cfg['allowDrag']);

        $c = Vps_Component_Data_Root::getInstance()->getComponentById('3');
        $cfg = Vps_Controller_Action_Component_PagesController::getNodeConfig($c, $user, $this->_acl);
        $this->assertTrue($cfg['actions']['properties']);
        $this->assertTrue($cfg['actions']['delete']);
        $this->assertTrue($cfg['actions']['makeHome']);
        $this->assertTrue($cfg['actions']['add']);
        $this->assertTrue($cfg['allowDrop']);
        $this->assertTrue($cfg['allowDrag']);
    }
}
{'fraction_non_alphanumeric': 0.19769711163153786, 'fraction_numerical': 0.00078064012490242, 'mean_word_length': 4.261806981519507, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6958838', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1453, 'n_words': 167}