Code Duplication    Length = 19-23 lines in 2 locations

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

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