Code Duplication    Length = 19-23 lines in 2 locations

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

@@ 153-175 (lines=23) @@
150
     * @covers \eZ\Publish\API\Repository\UserService::loadSubUserGroups
151
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
152
     */
153
    public function testLoadSubUserGroupsThrowsNotFoundException()
154
    {
155
        $repository = $this->getRepository();
156
        $userService = $repository->getUserService();
157
158
        $parentGroup = new UserGroup(
159
            [
160
                'content' => new Content(
161
                    [
162
                        'versionInfo' => new VersionInfo(
163
                            [
164
                                'contentInfo' => new ContentInfo(
165
                                ['id' => 123456]
166
                            ),
167
                            ]
168
                        ),
169
                        'internalFields' => [],
170
                    ]
171
                ),
172
            ]
173
        );
174
        $userService->loadSubUserGroups($parentGroup);
175
    }
176
177
    /**
178
     * Test for the newUserGroupCreateStruct() method.
@@ 492-510 (lines=19) @@
489
     * @covers \eZ\Publish\API\Repository\UserService::deleteUserGroup
490
     * @expectedException \eZ\Publish\API\Repository\Exceptions\NotFoundException
491
     */
492
    public function testDeleteUserGroupThrowsNotFoundException()
493
    {
494
        $repository = $this->getRepository();
495
        $userService = $repository->getUserService();
496
497
        $userGroup = new UserGroup(
498
            [
499
                'content' => new Content(
500
                    [
501
                        'versionInfo' => new VersionInfo(
502
                            ['contentInfo' => new ContentInfo(['id' => 123456])]
503
                        ),
504
                        'internalFields' => [],
505
                    ]
506
                ),
507
            ]
508
        );
509
        $userService->deleteUserGroup($userGroup);
510
    }
511
512
    /**
513
     * Test for the moveUserGroup() method.