Code Duplication    Length = 17-28 lines in 2 locations

eZ/Publish/API/Repository/Tests/NotificationServiceTest.php 1 location

@@ 112-128 (lines=17) @@
109
    /**
110
     * @covers \eZ\Publish\API\Repository\NotificationService::deleteNotification()
111
     */
112
    public function testDeleteNotification()
113
    {
114
        $repository = $this->getRepository();
115
116
        $notificationId = $this->generateId('notification', 5);
117
        /* BEGIN: Use Case */
118
        $notificationService = $repository->getNotificationService();
119
        $notification = $notificationService->getNotification($notificationId);
120
        $notificationService->deleteNotification($notification);
121
        /* END: Use Case */
122
123
        try {
124
            $notificationService->getNotification($notificationId);
125
            $this->fail('Notification ' . $notificationId . ' not deleted.');
126
        } catch (NotFoundException $e) {
127
        }
128
    }
129
130
    /**
131
     * @covers \eZ\Publish\API\Repository\NotificationService::createNotification()

eZ/Publish/API/Repository/Tests/ObjectStateServiceTest.php 1 location

@@ 1693-1720 (lines=28) @@
1690
     * @see \eZ\Publish\API\Repository\ObjectStateService::deleteObjectStateGroup()
1691
     * @depends testLoadObjectStateGroup
1692
     */
1693
    public function testDeleteObjectStateGroup()
1694
    {
1695
        $repository = $this->getRepository();
1696
1697
        $objectStateGroupId = $this->generateId('objectstategroup', 2);
1698
        /* BEGIN: Use Case */
1699
        // $objectStateGroupId contains the ID of the standard object state
1700
        // group ez_lock.
1701
        $objectStateService = $repository->getObjectStateService();
1702
1703
        $loadedObjectStateGroup = $objectStateService->loadObjectStateGroup(
1704
            $objectStateGroupId
1705
        );
1706
1707
        $objectStateService->deleteObjectStateGroup($loadedObjectStateGroup);
1708
        /* END: Use Case */
1709
1710
        try {
1711
            $objectStateService->loadObjectStateGroup($objectStateGroupId);
1712
            $this->fail(
1713
                sprintf(
1714
                    'ObjectStateGroup with ID "%s" not deleted.',
1715
                    $objectStateGroupId
1716
                )
1717
            );
1718
        } catch (NotFoundException $e) {
1719
        }
1720
    }
1721
1722
    /**
1723
     * Delete existing (e.g. initial) object state groups.