<commit_before><?php

/*
 * This file is part of the Kreta package.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\Kreta\Component\User\Model;

use Kreta\Component\Media\Model\Interfaces\MediaInterface;
use PhpSpec\ObjectBehavior;

/**
 * Class UserSpec.
 *
 * @package spec\Kreta\Component\User\Model
 */
class UserSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Kreta\Component\User\Model\User');
    }

    function it_extends_fos_user_model()
    {
        $this->shouldHaveType('FOS\UserBundle\Model\User');
    }

    function it_implements_user_interface()
    {
        $this->shouldImplement('Kreta\Component\User\Model\Interfaces\UserInterface');
    }

    function it_should_not_have_id_by_default()
    {
        $this->getId()->shouldReturn(null);
    }

    function its_created_at_is_a_datetime()
    {
        $this->getCreatedAt()->shouldHaveType('DateTime');
    }

    function its_created_at_is_mutable()
    {
        $createDate = new \DateTime();

        $this->setCreatedAt($createDate)->shouldReturn($this);
        $this->getCreatedAt()->shouldReturn($createDate);
    }

    function its_first_name_is_mutable()
    {
        $this->setFirstName('The dummy first name')->shouldReturn($this);
        $this->getFirstName()->shouldReturn('The dummy first name');
    }

    function its_full_name_returns_null_if_first_name_and_last_name_are_null()
    {
        $this->getFullName()->shouldReturn(null);
    }

    function its_full_name_returns_last_name_if_first_name_is_null()
    {
        $this->setLastName('surname')->shouldReturn($this);

        $this->getFullName()->shouldReturn('surname');
    }

    function its_full_name_returns_first_name_if_last_name_is_null()
    {
        $this->setFirstName('name')->shouldReturn($this);

        $this->getFullName()->shouldReturn('name');
    }

    function its_full_name_returns_first_name_plus_last_name_if_it_is_default_situation()
    {
        $this->setFirstName('name')->shouldReturn($this);
        $this->setLastName('surname')->shouldReturn($this);

        $this->getFullName()->shouldReturn('name surname');
    }

    function its_last_name_is_mutable()
    {
        $this->setLastName('The dummy last name')->shouldReturn($this);
        $this->getLastName()->shouldReturn('The dummy last name');
    }

    function its_photo_is_mutable(MediaInterface $media)
    {
        $this->setPhoto($media)->shouldReturn($this);
        $this->getPhoto()->shouldReturn($media);
    }

    function its_salt_returns_null()
    {
        $this->getSalt(->shouldReturn(null);
    }
}
<commit_msg>Fixed a typo<commit_after><?php

/*
 * This file is part of the Kreta package.
 *
 * (c) <NAME> <<EMAIL>>
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace spec\Kreta\Component\User\Model;

use Kreta\Component\Media\Model\Interfaces\MediaInterface;
use PhpSpec\ObjectBehavior;

/**
 * Class UserSpec.
 *
 * @package spec\Kreta\Component\User\Model
 */
class UserSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Kreta\Component\User\Model\User');
    }

    function it_extends_fos_user_model()
    {
        $this->shouldHaveType('FOS\UserBundle\Model\User');
    }

    function it_implements_user_interface()
    {
        $this->shouldImplement('Kreta\Component\User\Model\Interfaces\UserInterface');
    }

    function it_should_not_have_id_by_default()
    {
        $this->getId()->shouldReturn(null);
    }

    function its_created_at_is_a_datetime()
    {
        $this->getCreatedAt()->shouldHaveType('DateTime');
    }

    function its_created_at_is_mutable()
    {
        $createDate = new \DateTime();

        $this->setCreatedAt($createDate)->shouldReturn($this);
        $this->getCreatedAt()->shouldReturn($createDate);
    }

    function its_first_name_is_mutable()
    {
        $this->setFirstName('The dummy first name')->shouldReturn($this);
        $this->getFirstName()->shouldReturn('The dummy first name');
    }

    function its_full_name_returns_null_if_first_name_and_last_name_are_null()
    {
        $this->getFullName()->shouldReturn(null);
    }

    function its_full_name_returns_last_name_if_first_name_is_null()
    {
        $this->setLastName('surname')->shouldReturn($this);

        $this->getFullName()->shouldReturn('surname');
    }

    function its_full_name_returns_first_name_if_last_name_is_null()
    {
        $this->setFirstName('name')->shouldReturn($this);

        $this->getFullName()->shouldReturn('name');
    }

    function its_full_name_returns_first_name_plus_last_name_if_it_is_default_situation()
    {
        $this->setFirstName('name')->shouldReturn($this);
        $this->setLastName('surname')->shouldReturn($this);

        $this->getFullName()->shouldReturn('name surname');
    }

    function its_last_name_is_mutable()
    {
        $this->setLastName('The dummy last name')->shouldReturn($this);
        $this->getLastName()->shouldReturn('The dummy last name');
    }

    function its_photo_is_mutable(MediaInterface $media)
    {
        $this->setPhoto($media)->shouldReturn($this);
        $this->getPhoto()->shouldReturn($media);
    }

    function its_salt_returns_null()
    {
        $this->getSalt()->shouldReturn(null);
    }
}

{'fraction_non_alphanumeric': 0.13909774436090225, 'fraction_numerical': 0.0, 'mean_word_length': 3.494770716009654, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 97, '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': '1089602', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1740, 'n_words': 232}