<commit_before><?php

class UserTest extends TestCase
{
    /**
     * @dataProvider getAges
     */
    public function testSetAgeAttribute($age, $expected_age)
    {
        $user = factory('App\User')->create(['age' => $age]);

        $user = \App\User::find($user->id);

        $this->assertSame($expected_age, $user->age);
    }

    public function getAges()
    {
        return [
            [0, 0],
            [1, 1],
            ['21', 21],
            [34, 34],
            [99, 99]
        ];
    }

    public function testSetEmailAttribute()
    {
        $user = factory('App\User')->create(['email' => '<EMAIL>']);
        $user = \App\User::find($user->id);

        $this->assertSame('<EMAIL>', $user->email);
    }

    public function testReviews()
    {
        $user = factory('App\User')->create(['email' => '<EMAIL>']);
        $reviews = $user->reviews();
        $this->assertInstanceOf('\Illuminate\Database\Eloquent\Relations\HasMany', $reviews);
    }
}<commit_msg>if age is not formatted well, expect an exception<commit_after><?php

class UserTest extends TestCase
{
    /**
     * @dataProvider getAges
     */
    public function testSetAgeAttribute($age, $expected_age)
    {
        $user = factory('App\User')->create(['age' => $age]);

        $user = \App\User::find($user->id);

        $this->assertSame($expected_age, $user->age);
    }

    public function getAges()
    {
        return [
            [0, 0],
            [1, 1],
            ['21', 21],
            [34, 34],
            [99, 99]
        ];
    }

    /**
     * @dataProvider getBadAges
     * @expectedException \Exception
     */
    public function testSetBadAgeAttribute($age)
    {
        $user = factory('App\User')->create(['age' => $age]);
    }

    public function getBadAges()
    {
        return [
            [-1],
            ['foo'],
            [null]
        ];
    }

    public function testSetEmailAttribute()
    {
        $user = factory('App\User')->create(['email' => '<EMAIL>']);
        $user = \App\User::find($user->id);

        $this->assertSame('<EMAIL>', $user->email);
    }

    public function testReviews()
    {
        $user = factory('App\User')->create(['email' => '<EMAIL>']);
        $reviews = $user->reviews();
        $this->assertInstanceOf('\Illuminate\Database\Eloquent\Relations\HasMany', $reviews);
    }
}
{'fraction_non_alphanumeric': 0.18431041754533953, 'fraction_numerical': 0.013918177983973008, 'mean_word_length': 2.029374201787995, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4289582', 'n_tokens_mistral': 766, 'n_tokens_neox': 732, 'n_words': 129}