<commit_before><?php

/**
 * Description of RuleTest
 *
 * @author mafonso
 */
class RuleTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @expectedException \Exception
     */
    public function testInvalidRule()
    {
        new \Arch\Rule(null, new \Arch\Input);
    }
    
    /**
     * @expectedException \Exception
     */
    public function testInvalidRuleMessage()
    {
        $rule = new \Arch\Rule(null, new \Arch\Input);
        $rule->setErrorMessage(NULL);
    }
    
    /**
     * @expectedException \Exception
     */
    public function testInvalidRuleAction()
    {
        $rule = new \Arch\Rule(null, new \Arch\Input);
        $rule->setAction(NULL);
    }

    /**
     * Test create rule
     */
    
    public function testCreateRule()
    {
        $expected = 'test';
        $rule = new \Arch\Rule($expected, new \Arch\Input);
        $result = $rule->getName();
        $this->assertEquals($expected, $result);
        
        $expected = 'required';
        $result = $rule->getAction();
        $this->assertEquals($expected, $result);
        
        $expected = 'test';<commit_msg>Improve Rule tests to 100%<commit_after><?php

/**
 * Description of RuleTest
 *
 * @author mafonso
 */
class RuleTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @expectedException \Exception
     */
    public function testInvalidRule()
    {
        new \Arch\Rule(null, new \Arch\Input);
    }
    
    /**
     * @expectedException \Exception
     */
    public function testInvalidAction()
    {
        $rule = new \Arch\Rule('param', new \Arch\Input);
        $rule->setAction(NULL);
    }
    
    /**
     * @expectedException \Exception
     */
    public function testInvalidErrorMessage()
    {
        $rule = new \Arch\Rule('param', new \Arch\Input);
        $rule->setErrorMessage(NULL);
    }
    
    /**
     * Test create rule
     */
    
    public function testCreateRule()
    {
        $expected = 'test';
        $rule = new \Arch\Rule($expected, new \Arch\Input);
        $result = $rule->getName();
        $this->assertEquals($expected, $result);
        
        $expected = 'required';
        $result = $rule->getAction();
        $this->assertEquals($expected, $result);
        
        $expected = 'test';
{'fraction_non_alphanumeric': 0.14354697102721686, 'fraction_numerical': 0.0013169446883230904, 'mean_word_length': 1.9868938401048493, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6473560', 'n_tokens_mistral': 663, 'n_tokens_neox': 659, 'n_words': 135}