<?php

namespace Oro\Bundle\UserBundle\Tests\Unit\Entity;

use Oro\Bundle\UserBundle\Entity\Role;

class RoleTest extends \PHPUnit_Framework_TestCase
{
    public function testCreate()
    {
        $strRole = 'foo';
        $role = new Role($strRole);

        $this->assertEquals($strRole, $role->getLabel());
        $this->assertEquals($strRole, $role->getRole());
    }

    public function testRole()
    {
        $role = new Role();

        $this->assertEmpty($role->getId());
        $this->assertEmpty($role->getRole());

        $role->setRole('foo');

        $this->assertStringStartsWith('ROLE_FOO', $role->getRole());
        $this->assertEquals(Role::PREFIX_ROLE, $role->getPrefix());
    }

    public function testLabel()
    {
        $role = new Role();
        $label = 'Test role';

        $this->assertEmpty($role->getLabel());

        $role->setLabel($label);

        $this->assertEquals($label, $role->getLabel());
        $this->assertEquals($label, (string)$role);
    }

    
    public function testClone()
    {
        $role = new Role();

        $class = new \ReflectionClass($role);
        $prop  = $class->getProperty('id');
        $prop->setAccessible(true);
        $prop->setValue($role, 1);

        $copy = clone $role;
        $this->assertEmpty($copy->getId());
    }
}

<?php

namespace Oro\Bundle\UserBundle\Tests\Unit\Entity;

use Oro\Bundle\UserBundle\Entity\Role;

class RoleTest extends \PHPUnit_Framework_TestCase
{
    public function testCreate()
    {
        $strRole = 'foo';
        $role = new Role($strRole);

        $this->assertEquals($strRole, $role->getLabel());
        $this->assertEquals($strRole, $role->getRole());
    }

    public function testRole()
    {
        $role = new Role();

        $this->assertEmpty($role->getId());
        $this->assertEmpty($role->getRole());

        $role->setRole('foo');

        $this->assertStringStartsWith('ROLE_FOO', $role->getRole());
        $this->assertEquals(Role::PREFIX_ROLE, $role->getPrefix());
    }

    public function testLabel()
    {
        $role = new Role();
        $label = 'Test role';

        $this->assertEmpty($role->getLabel());

        $role->setLabel($label);

        $this->assertEquals($label, $role->getLabel());
        $this->assertEquals($label, (string)$role);
    }

    public function testClone()
    {
        $role = new Role();

        $class = new \ReflectionClass($role);
        $prop  = $class->getProperty('id');
        $prop->setAccessible(true);
        $prop->setValue($role, 1);

        $copy = clone $role;
        $this->assertEmpty($copy->getId());
    }
}

Add new flag to the role entity - removed unneseccary empty line
BB-3603: Add new flag to the role entity
- removed unneseccary empty line
