* User: tylercazier
 * Date: 11/29/15
 * Time: 8:38 PM
 */
use Notes\Domain\Entity\Role\OwnerRole;
use Notes\Domain\ValueObject\Uuid;
describe('Notes\\Domain\\Entity\\Role\\OwnerRole', function () {
    describe('-->__construct()', function () {
        it('should construct a new OwnerRole object', function () {
            $faker = \Faker\Factory::create();
            $ownerRole = new OwnerRole($faker->uuid);
            expect($ownerRole)->to->be->instanceof('Notes\\Domain\\Entity\\Role\\OwnerRole');
        });
    });
    describe('-->getId()', function () {
        it('should return the OwnerRole roleId', function () {
            $faker = \Faker\Factory::create();
            $roleId = $faker->uuid;
            $ownerRole = new OwnerRole($roleId);
            expect($ownerRole->getId())->equal($roleId);
        });
    });
    describe('-->getPermissions()', function () {
        it('should return the OwnerRole roleId', function () {
            $ownerRole = new OwnerRole(new Uuid());
            for ($i = 0; $i < 4; $i++) {
                expect($ownerRole->getPermissions()[$i])->equal($i);
            }
        });
    });
});
            $permission = 5;
            $owner->addPermission($permission);
            expect(count($owner->getPermissions()))->to->be->equal(1);
            expect($owner->getPermissions()[0])->to->be->equal($permission);
        });
    });
    describe('->__removePermission()', function () {
        it('should return the correct permission when added', function () {
            $owner = new OwnerRole();
            /** @var int $permission */
            $permission = 5;
            $owner->addPermission($permission);
            expect(count($owner->getPermissions()))->to->be->equal(1);
            expect($owner->getPermissions()[0])->to->be->equal($permission);
            $owner->removePermission($permission);
            expect(count($owner->getPermissions()))->to->be->equal(0);
        });
        it('should return false if the permission does not exist', function () {
            $owner = new OwnerRole();
            /** @var int $permission */
            $permission = 5;
            /** @var int $permission */
            $invalidPermission = 6;
            $owner->addPermission($permission);
            expect(count($owner->getPermissions()))->to->be->equal(1);
            expect($owner->getPermissions()[0])->to->be->equal($permission);
            $result = $owner->removePermission($invalidPermission);
            expect($result)->to->be->false;
        });
    });
});