<commit_before><?php

namespace Egulias\Tests\EmailValidator;

use Egulias\EmailValidator\EmailValidator;

class EmailValidatorTest extends \PHPUnit_Framework_TestCase
{
    protected $validator;

    protected function setUp()
    {
        $this->validator = new EmailValidator();
    }

    protected function tearDown()
    {
        $this->validator = null;
    }

    /**
     * @dataProvider getValidEmails
     */
    public function testValidEmails($email)
    {
        $this->assertTrue($this->validator->isValid($email));
    }

    public function getValidEmails()
    {
        return array(
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('example@localhost'),
            array('<EMAIL>\'<EMAIL>'),
            array('fab\ i<EMAIL>'),
            array('example((example))<EMAIL>'),
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('"username"@<EMAIL>'),
            array('"user,name"@<EMAIL>'),
            array('"user name"@<EMAIL>'),
            array('"user@<EMAIL>"@<EMAIL>'),
            array('"\a"@iana.<EMAIL>'),
            array('"test\ test"@<EMAIL>'),
            array('""@<EMAIL>'),
            array('"\""@<EMAIL>'),
//            array('"\\"@<EMAIL>'),
        );
    }

    /**
     * @dataProvider getInvalidEmails
     */
    public function testInvalidEmails($email)
    {
        $this->assertFalse($this->validator->isValid($email));
    }

    public function getInvalidEmails()
    {
        return array(

            array('<EMAIL>'),
            array('<EMAIL>'),
            array('(<EMAIL>)'),
            array('example(example)<EMAIL>'),
            array('.example@localhost'),
            array('ex\ample@localhost'),
            array('example@local\host'),
            array('example@localhost.'),
            array('user <EMAIL>'),
            array('username@ example . com'),
            array('example@(fake).com'),
            array('example@(fake.com'),
            array('username@<EMAIL>,com'),
            array('usern,<EMAIL>'),
            array('user[na]<EMAIL>'),
            array('"""<EMAIL>'),
            array('"\"<EMAIL>'),
            array('"test"<EMAIL>'),
            array('"test""<EMAIL>"<EMAIL>'),
            array('"test"."<EMAIL>"<EMAIL>'),
            array('"test".<EMAIL>'),
            array('"test"' . chr(0) . '@iana.org'),
            array('"test\"<EMAIL>'),
//            array('<EMAIL>'),
//            array('<EMAIL>'),
//            array('""@<EMAIL>'),
            array(chr(226) . '@iana.org'),
            array('test@' . chr(226) . '.org'),
            array('\r\<EMAIL>'),
            array('\r\n <EMAIL>'),
            array('\r\n \<EMAIL>'),
            array('\r\n \r\<EMAIL>'),
            array('\r\n \r\n <EMAIL>'),
            array('<EMAIL> \r\n'),
            array('<EMAIL> \r\n '),
            array('<EMAIL> \r\n \r\n'),
            array('<EMAIL> \r\n\r\n'),
            array('<EMAIL>  \r\n\r\n '),
            array('test@iana/icann.org'),
        );
    }<commit_msg>Remove under development tests emails<commit_after><?php

namespace Egulias\Tests\EmailValidator;

use Egulias\EmailValidator\EmailValidator;

class EmailValidatorTest extends \PHPUnit_Framework_TestCase
{
    protected $validator;

    protected function setUp()
    {
        $this->validator = new EmailValidator();
    }

    protected function tearDown()
    {
        $this->validator = null;
    }

    /**
     * @dataProvider getValidEmails
     */
    public function testValidEmails($email)
    {
        $this->assertTrue($this->validator->isValid($email));
    }

    public function getValidEmails()
    {
        return array(
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('example@localhost'),
            array('<EMAIL>\'<EMAIL>'),
            array('fab\ <EMAIL>'),
            array('example((<EMAIL>))<EMAIL>'),
            array('<EMAIL>'),
            array('<EMAIL>'),
            array('инф<EMAIL>'),
            array('"username"@<EMAIL>'),
            array('"user,name"@<EMAIL>'),
            array('"user name"@<EMAIL>'),
            array('"user@<EMAIL>"@<EMAIL>'),
            array('"\a"@<EMAIL>'),
            array('"test\ test"@<EMAIL>'),
            array('""@<EMAIL>'),
            array('"\""@<EMAIL>'),
        );
    }

    /**
     * @dataProvider getInvalidEmails
     */
    public function testInvalidEmails($email)
    {
        $this->assertFalse($this->validator->isValid($email));
    }

    public function getInvalidEmails()
    {
        return array(

            array('<EMAIL>'),
            array('<EMAIL>'),
            array('(<EMAIL>)'),
            array('example(example)<EMAIL>'),
            array('.example@localhost'),
            array('ex\ample@localhost'),
            array('example@local\host'),
            array('example@localhost.'),
            array('user <EMAIL>'),
            array('username@ example . com'),
            array('example@(fake).com'),
            array('example@(fake.com'),
            array('username@<EMAIL>'),
            array('usern,<EMAIL>'),
            array('user[na]<EMAIL>'),
            array('"""<EMAIL>'),
            array('"\"@<EMAIL>'),
            array('"test"<EMAIL>'),
            array('"test""<EMAIL>"@<EMAIL>'),
            array('"test"."<EMAIL>"@<EMAIL>'),
            array('"test".<EMAIL>'),
            array('"test"' . chr(0) . '@iana.org'),
            array('"<EMAIL>'),
            array(chr(226) . '@iana.org'),
            array('test@' . chr(226) . '.org'),
            array('\r\nt<EMAIL>'),
            array('\r\n <EMAIL>'),
            array('\r\n \r\<EMAIL>'),
            array('\r\n \r\<EMAIL>'),
            array('\r\n \r\n <EMAIL>'),
            array('<EMAIL> \r\n'),
            array('<EMAIL> \r\n '),
            array('<EMAIL> \r\n \r\n'),
            array('<EMAIL> \r\n\r\n'),
            array('<EMAIL>  \r\n\r\n '),
            array('test@iana/icann.org'),
        );
    }
{'fraction_non_alphanumeric': 0.2074913750616067, 'fraction_numerical': 0.0022999835715459176, 'mean_word_length': 1.8055299539170506, 'pattern_counts': {'":': 0, '<': 102, '<?xml version=': 0, '>': 116, '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': '4667257', 'n_tokens_mistral': 1876, 'n_tokens_neox': 1867, 'n_words': 248}