<commit_before><?php
namespace rockunit;


use rock\validate\Validate;

class EmailTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider providerValid
     */
    public function testValid($email)
    {
        $validator = Validate::email();
        $this->assertTrue($validator->validate($email));
    }

    /**
     * @dataProvider providerInvalid
     */
    public function testInvalid($email)
    {
        $validator = Validate::email();
        $this->assertFalse($validator->validate($email));
    }

    public function providerValid()
    {
        return [
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['test@золотой--ларец.рф'],
            ['<EMAIL>.xn--p1ai'],
            ['contact@xn----8sbpfklcuba0as3d.xn--p1ai'],
            ['<EMAIL>'],
            ['test@ä-.xe'],
            ['<EMAIL>'],
            ['user@[255.255.255.255]'],
            ['user@[IPv6:2001:db8:1ff::a0b:dbd0]'],
            ['user@[IPv6:2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'],
            ['user@[IPv6:1111:2222:3333:4444:5555:6666:255.255.255.255]']
        ];
    }

    public function providerInvalid()
    {
        return [
            ['<EMAIL>'],
            [' <EMAIL>@<EMAIL>'],
            ['test@test'],
            ['test'],
            ['test@'],
            ['<EMAIL>'],
            ['@'],
            ['<EMAIL>'],
            ['<EMAIL>-'],
            ['<EMAIL>..<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['(comment)<EMAIL>'],
            ['this\ still\"<EMAIL>'],
            ['test.test@'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['test@test..com'],
            ['<EMAIL>.'],
            ['.<EMAIL>'],
            ['test@a[255.255.255.255]'],
            ['test@[255.255.255]'],
            ['test@[255.255.255.255.255]'],
            ['test@[255.255.255.256]'],
            ['test@[2001::7344]'],
            ['test@[IPv6:1111:2222:3333:4444:5555:6666:7777:255.255.255.255]'],
            ['test@[1.2.3.4'],
        ];
    }
}
<commit_msg>Added tests.<commit_after><?php
namespace rockunit;


use rock\validate\Validate;

class EmailTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider providerValid
     */
    public function testValid($email)
    {
        $validator = Validate::email();
        $this->assertTrue($validator->validate($email));
    }

    /**
     * @dataProvider providerInvalid
     */
    public function testInvalid($email)
    {
        $validator = Validate::email();
        $this->assertFalse($validator->validate($email));
    }

    public function providerValid()
    {
        return [
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['a@a.a'],
            ['<EMAIL>'],
            ['test@золотой-ларец.рф'],
            ['<EMAIL>'],
            ['<EMAIL>@test.xn--p1ai'],
            ['contact@xn----8sbpfklcuba0as3d.xn--p1ai'],
            ['<EMAIL>'],
            ['test@ä-.xe'],
            ['<EMAIL>'],
            ['user@[255.255.255.255]'],
            ['user@[IPv6:2001:db8:1ff::a0b:dbd0]'],
            ['user@[IPv6:2001:0db8:85a3:08d3:1319:8a2e:0370:7344]'],
            ['user@[IPv6:1111:2222:3333:4444:5555:6666:255.255.255.255]']
        ];
    }

    public function providerInvalid()
    {
        return [
            ['test@t@test'],
            [' test@t@test'],
            ['test@test'],
            ['test'],
            ['test@'],
            ['<EMAIL>'],
            ['@'],
            ['<EMAIL>'],
            ['<EMAIL>-'],
            ['foo<EMAIL>'],
            ['foo@foo-.<EMAIL>'],
            ['test..<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['(comment)<EMAIL>'],
            ['this\ still\"<EMAIL>'],
            ['test.test@'],
            ['<EMAIL>'],
            ['<EMAIL>'],
            ['test@<EMAIL>..<EMAIL>'],
            ['<EMAIL>.'],
            ['.<EMAIL>'],
            ['test@a[255.255.255.255]'],
            ['test@[255.255.255]'],
            ['test@[255.255.255.255.255]'],
            ['test@[255.255.255.256]'],
            ['test@[2001::7344]'],
            ['test@[IPv6:1111:2222:3333:4444:5555:6666:7777:255.255.255.255]'],
            ['test@[1.2.3.4'],
        ];
    }
}

{'fraction_non_alphanumeric': 0.22389400404221874, 'fraction_numerical': 0.08578486413653717, 'mean_word_length': 1.579038795599305, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 17, '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': '3785004', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1516, 'n_words': 159}