Code Duplication    Length = 19-23 lines in 2 locations

eZ/Publish/API/Repository/Tests/UserServiceTest.php 2 locations

@@ 106-128 (lines=23) @@
103
     * @covers \eZ\Publish\API\Repository\UserService::loadSubUserGroups
104
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
105
     */
106
    public function testLoadSubUserGroupsThrowsNotFoundException()
107
    {
108
        $repository = $this->getRepository();
109
        $userService = $repository->getUserService();
110
111
        $parentGroup = new UserGroup(
112
            [
113
                'content' => new Content(
114
                    [
115
                        'versionInfo' => new VersionInfo(
116
                            [
117
                                'contentInfo' => new ContentInfo(
118
                                ['id' => 123456]
119
                            ),
120
                            ]
121
                        ),
122
                        'internalFields' => [],
123
                    ]
124
                ),
125
            ]
126
        );
127
        $userService->loadSubUserGroups($parentGroup);
128
    }
129
130
    /**
131
     * Test for the newUserGroupCreateStruct() method.
@@ 474-492 (lines=19) @@
471
     * @covers \eZ\Publish\API\Repository\UserService::deleteUserGroup
472
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
473
     */
474
    public function testDeleteUserGroupThrowsNotFoundException()
475
    {
476
        $repository = $this->getRepository();
477
        $userService = $repository->getUserService();
478
479
        $userGroup = new UserGroup(
480
            [
481
                'content' => new Content(
482
                    [
483
                        'versionInfo' => new VersionInfo(
484
                            ['contentInfo' => new ContentInfo(['id' => 123456])]
485
                        ),
486
                        'internalFields' => [],
487
                    ]
488
                ),
489
            ]
490
        );
491
        $userService->deleteUserGroup($userGroup);
492
    }
493
494
    /**
495
     * Test for the moveUserGroup() method.