<commit_before><?php

namespace Respect\Validation\Rules;

class CnpjTest extends \PHPUnit_Framework_TestCase {

    protected $cnpjValidator;

    protected function setUp() 
    {
        $this->cnpjValidator = new Cnpj;
    }
    
    /**
     * @dataProvider providerValidFormattedCnpj
     */
    public function test_formatted_cnpjs_should_validate($input) 
    {
        $this->assertTrue($this->cnpjValidator->assert($input));
    }

    /**
     * @dataProvider providerValidUnformattedCnpj
     */
    public function test_unformatted_cnpjs_should_validates($input) 
    {
        $this->assertTrue($this->cpfValidator->assert($input));
    }

    /**
     * @dataProvider providerInvalidFormattedCnpj
     */
    public function test_invalid_cnpj_should_fail_when_formatted($input) 
    {
        $this->assertFalse($this->cnpjValidator->assert($input));
    }

    /**
     * @dataProvider providerInvalidUnformattedCnpj
     */
    public function test_invalid_cnpj_should_fail_when_not_formatted($input) 
    {
        $this->assertFalse($this->cnpjValidator->assert($input));
    }

    
    /**
     * @dataProvider providerInvalidFormattedAndUnformattedCnpjLength
     */
    public function test_cnpjs_with_incorrect_length_should_fail($input) 
    {
        $this->assertFalse($this->cnpjValidator->assert($input));
    }
    
    public function providerValidFormattedCnpj() 
    {
        return array(
            array('342.444.198-88'),
            array('342.444.198.88'),
            array('350.45261819'),
            array('693-319-118-40'),
            array('3.6.8.8.9.2.5.5.4.8.8')
        );
    }

    public function providerValidUnformattedCnpj() 
    {
        return array(
            array('11598647644'),
            array('86734718697'),
            array('86223423284'),
            array('24845408333'),
            array('95574461102'),
        );
    }

    public function providerInvalidFormattedCnpj() 
    {
        return array(
            array('000.000.000-00'),
            array('111.222.444-05'),
            array('999999999.99'),
            array('8.8.8.8.8.8.8.8.8.8.8'),
            array('693-319-110-40'),
            array('698.111-111.00')
        );
    }

    public function providerInvalidUnformattedCnpj()
    {
        return array(
            array('11111111111'),
            array('22222222222'),
            array('12345678900'),
            array('99299929384'),
            array('84434895894'),
            array('44242340000')
        );
    }
    
    public function providerInvalidFormattedAndUnformattedCnpjLength()
    {
        return array(
            array('1'),
            array('22'),
            array('123'),
            array('992999999999929384'),
            array('')
        );
    }
}<commit_msg>some changes in cnpj validators tests<commit_after><?php

namespace Respect\Validation\Rules;

class CnpjTest extends \PHPUnit_Framework_TestCase {

    protected $cnpjValidator;

    protected function setUp() 
    {
        $this->cnpjValidator = new Cnpj;
    }
    
    /**
     * @dataProvider providerValidFormattedCnpj
     */
    public function test_formatted_cnpjs_should_validate($input) 
    {
        $this->assertTrue($this->cnpjValidator->validate($input));
    }

    /**
     * @dataProvider providerValidUnformattedCnpj
     */
    public function test_unformatted_cnpjs_should_validates($input) 
    {
        $this->assertTrue($this->cpfValidator->validate($input));
    }

    /**
     * @dataProvider providerInvalidFormattedCnpj
     */
    public function test_invalid_cnpj_should_fail_when_formatted($input) 
    {
        $this->assertFalse($this->cnpjValidator->validate($input));
    }

    /**
     * @dataProvider providerInvalidUnformattedCnpj
     */
    public function test_invalid_cnpj_should_fail_when_not_formatted($input) 
    {
        $this->assertFalse($this->cnpjValidator->validate($input));
    }

    
    /**
     * @dataProvider providerInvalidFormattedAndUnformattedCnpjLength
     */
    public function test_cnpjs_with_incorrect_length_should_fail($input) 
    {
        $this->assertFalse($this->cnpjValidator->validate($input));
    }
    
    public function providerValidFormattedCnpj() 
    {
        return array(
            array('32.063.364/0001-07'),
            array('24.663.454/0001-00'),
            array('57.535.083/0001-30'),
            array('24.760.428/0001-09'),
            array('27.355.204/0001-00')
        );
    }

    public function providerValidUnformattedCnpj() 
    {
        return array(
            array('11598647644'),
            array('86734718697'),
            array('12774546000189'),
            array('77456211000168'),
            array('02023077000102'),
        );
    }

    public function providerInvalidFormattedCnpj() 
    {
        return array(
            array('00.000.000/0000-00'),
            array('11.111.111/1111-11'),
        );
    }

    public function providerInvalidUnformattedCnpj()
    {
        return array(
            array('11111111111'),
            array('22222222222'),
            array('12345678900'),
            array('99299929384'),
            array('84434895894'),
            array('44242340000')
        );
    }
    
    public function providerInvalidFormattedAndUnformattedCnpjLength()
    {
        return array(
            array('1'),
            array('22'),
            array('123'),
            array('992999999999929384'),
            array('99-010-0.')
        );
    }
}
{'fraction_non_alphanumeric': 0.12529465095194922, 'fraction_numerical': 0.09501359927470535, 'mean_word_length': 2.126984126984127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 7, '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': '2762576', 'n_tokens_mistral': 2003, 'n_tokens_neox': 1650, 'n_words': 195}