<commit_before><?php

namespace Criterion\Test\Model;

class UserModelTest extends \Criterion\Test\TestCase
{

    public function testInit()
    {
        $user = new \Criterion\Model\User();
        $this->assertTrue(is_object($user));
    }

    public function testIsAdminFalse()
    {
        $user = new \Criterion\Model\User();
        $this->assertFalse($user->isAdmin());
    }

    public function testIsAdminTrue()
    {
        $user = new \Criterion\Model\User();
        $user->role = 'admin';
        $this->assertTrue($user->isAdmin());
    }
}<commit_msg>Test User model password functions<commit_after><?php

namespace Criterion\Test\Model;

class UserModelTest extends \Criterion\Test\TestCase
{

    public function testInit()
    {
        $user = new \Criterion\Model\User();
        $this->assertTrue(is_object($user));
    }

    public function testPasswordFail()
    {
        $user = new \Criterion\Model\User();
        $this->assertTrue(is_object($user));

        $this->assertFalse($user->password('<PASSWORD>'));
    }

    public function testPassword()
    {
        $user = new \Criterion\Model\User();
        $this->assertTrue(is_object($user));

        $password = '<PASSWORD>';

        $user->password = $password;
        $user->password = $user->password();

        $this->assertTrue($user->password($password));
    }

    public function testIsAdminFalse()
    {
        $user = new \Criterion\Model\User();
        $this->assertFalse($user->isAdmin());
    }

    public function testIsAdminTrue()
    {
        $user = new \Criterion\Model\User();
        $user->role = 'admin';
        $this->assertTrue($user->isAdmin());
    }
}
{'fraction_non_alphanumeric': 0.15842763549731984, 'fraction_numerical': 0.0, 'mean_word_length': 2.582089552238806, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 26, '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': '5315024', 'n_tokens_mistral': 488, 'n_tokens_neox': 493, 'n_words': 86}