<commit_before><commit_msg>III-940: Add RenameRoleTest<commit_after><?php

namespace CultuurNet\UDB3\Role\Commands;

use ValueObjects\Identity\UUID;
use ValueObjects\String\String as StringLiteral;

class RenameRoleTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var UUID
     */
    protected $uuid;

    /**
     * @var StringLiteral
     */
    protected $name;

    /**
     * @var RenameRole
     */
    protected $renameRole;

    protected function setUp()
    {
        $this->uuid = new UUID();

        $this->name = new StringLiteral('newRoleName');

        $this->renameRole = new RenameRole(
            $this->uuid,
            $this->name
        );
    }

    /**
     * @test
     */
    public function it_extends_an_abstract_command()
    {
        $this->assertTrue(is_subclass_of(
            $this->renameRole,
            AbstractCommand::class
        ));
    }

    /**
     * @test
     */
    public function it_stores_a_uuid()
    {
        $this->assertEquals($this->uuid, $this->renameRole->getUuid());
    }

    /**
     * @test
     */
    public function it_stores_a_name()
    {
        $this->assertEquals($this->name, $this->renameRole->getName());
    }

    /**
     * @test
     */
    public function it_can_serialize()
    {
        $actualCreate = unserialize(serialize($this->renameRole));

        $this->assertEquals($this->renameRole, $actualCreate);
    }
}

{'fraction_non_alphanumeric': 0.1389280677009873, 'fraction_numerical': 0.0028208744710860366, 'mean_word_length': 2.0847826086956522, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 21, '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': '395062', 'n_tokens_mistral': 444, 'n_tokens_neox': 442, 'n_words': 68}