<commit_before><?php


class ACLActionTest extends PHPUnit_Framework_TestCase{

	
	public function testACLAction(){
		
		//execute the contructor and check for the Object type and type attribute
		$aclAction = new ACLAction();
		$this->assertInstanceOf('ACLAction',$aclAction);
		$this->assertInstanceOf('SugarBean',$aclAction);
		
		$this->assertAttributeEquals('ACLActions', 'module_dir', $aclAction);
		$this->assertAttributeEquals('ACLAction', 'object_name', $aclAction);				
		$this->assertAttributeEquals('acl_actions', 'table_name', $aclAction);
		$this->assertAttributeEquals(true, 'new_schema', $aclAction);
		$this->assertAttributeEquals(true, 'disable_custom_fields', $aclAction);
		
    }


    public function testaddActions(){
		
    	error_reporting(E_ERROR | E_PARSE);
    	
    	//take count of actions initially and then after method execution and test if action count increases
    	$action_count = count(ACLAction::getDefaultActions());
    	ACLAction::addActions("Test");
    	$actual = ACLAction::getDefaultActions();
    	$this->assertGreaterThan($action_count, count($actual));
    	
    }


    public function testremoveActions(){

    	//take count of actions initially and then after method execution and test if action count decreases
    	$action_count = count(ACLAction::getDefaultActions());
    	ACLAction::removeActions("Test");
    	$actual = ACLAction::getDefaultActions();
    	$this->assertLessThan($action_count, count($actual));
    	
    }


    public function testAccessName(){

    	error_reporting(E_ERROR | E_PARSE);
    	
    	$this->assertFalse(ACLAction::AccessName('')); //test with invalid value
    	$this->assertEquals('All', ACLAction::AccessName(90)); //test with a valid value
    	
    }



    public function testgetDefaultActions(){
    	
    	$actual = ACLAction::getDefaultActions();
    	$this->assertTrue(is_array($actual)); //verify that it returns an array
    	$this->assertEquals(count($actual),392);  //verify that it returns array of expected size
  
    }


    public function testgetUserActions(){
        
    	$result1 = ACLAction::getUserActions('1');
    	$result2 = ACLAction::getUserActions('1',false,'Accounts');
    	$result3 = ACLAction::getUserActions('1',false,'Accounts','list');
    	
    	//verify that all three results retunred are different
    	$this->assertNotSame($result1,$result2);
    	$this->assertNotSame($result1,$result3);
    	$this->assertNotSame($result2,$result3);
    	
    }
    <commit_msg>Fix and tweak failing test<commit_after><?php


class ACLActionTest extends PHPUnit_Framework_TestCase{

	
	public function testACLAction(){
		
		//execute the contructor and check for the Object type and type attribute
		$aclAction = new ACLAction();
		$this->assertInstanceOf('ACLAction',$aclAction);
		$this->assertInstanceOf('SugarBean',$aclAction);
		
		$this->assertAttributeEquals('ACLActions', 'module_dir', $aclAction);
		$this->assertAttributeEquals('ACLAction', 'object_name', $aclAction);				
		$this->assertAttributeEquals('acl_actions', 'table_name', $aclAction);
		$this->assertAttributeEquals(true, 'new_schema', $aclAction);
		$this->assertAttributeEquals(true, 'disable_custom_fields', $aclAction);
		
    }


    public function testaddActions(){
		
    	error_reporting(E_ERROR | E_PARSE);
    	
    	//take count of actions initially and then after method execution and test if action count increases
    	$action_count = count(ACLAction::getDefaultActions());
    	ACLAction::addActions("Test");
    	$actual = ACLAction::getDefaultActions();
    	$this->assertGreaterThan($action_count, count($actual));
    	
    }


    public function testremoveActions(){

    	//take count of actions initially and then after method execution and test if action count decreases
    	$action_count = count(ACLAction::getDefaultActions());
    	ACLAction::removeActions("Test");
    	$actual = ACLAction::getDefaultActions();
    	$this->assertLessThan($action_count, count($actual));
    	
    }


    public function testAccessName(){

    	error_reporting(E_ERROR | E_PARSE);
    	
    	$this->assertFalse(ACLAction::AccessName('')); //test with invalid value
    	$this->assertEquals('All', ACLAction::AccessName(90)); //test with a valid value
    	
    }



    public function testgetDefaultActions(){
        global $beanList;
        $actual = ACLAction::getDefaultActions();
        $this->assertTrue(is_array($actual)); //verify that it returns an array
        foreach($actual as $acl){
            $this->assertInstanceOf("ACLAction",$acl);
        }
        $actual = ACLAction::getDefaultActions("module","list");
        $this->assertTrue(is_array($actual)); //verify that it returns an array
        foreach($actual as $acl){
            $this->assertInstanceOf("ACLAction",$acl);
            $this->assertEquals("list",$acl->name);
        }
    }


    public function testgetUserActions(){
        
    	$result1 = ACLAction::getUserActions('1');
    	$result2 = ACLAction::getUserActions('1',false,'Accounts');
    	$result3 = ACLAction::getUserActions('1',false,'Accounts','list');
    	
    	//verify that all three results retunred are different
    	$this->assertNotSame($result1,$result2);
    	$this->assertNotSame($result1,$result3);
    	$this->assertNotSame($result2,$result3);
    	
    }
    
{'fraction_non_alphanumeric': 0.13227016885553472, 'fraction_numerical': 0.005816135084427768, 'mean_word_length': 3.97294776119403, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '3742167', 'n_tokens_mistral': 1612, 'n_tokens_neox': 1523, 'n_words': 319}