Code Duplication    Length = 17-18 lines in 2 locations

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

@@ 56-72 (lines=17) @@
53
    /**
54
     * @covers \eZ\Publish\Core\Repository\BookmarkService::createBookmark
55
     */
56
    public function testCreateBookmark()
57
    {
58
        $repository = $this->getRepository();
59
60
        /* BEGIN: Use Case */
61
        $bookmarkService = $repository->getBookmarkService();
62
        $locationService = $repository->getLocationService();
63
64
        $location = $locationService->loadLocation($this->generateId('location', self::LOCATION_ID_NOT_BOOKMARKED));
65
        $beforeCreateBookmark = $bookmarkService->isBookmarked($location);
66
        $bookmarkService->createBookmark($location);
67
        $afterCreateBookmark = $bookmarkService->isBookmarked($location);
68
        /* END: Use Case */
69
70
        $this->assertFalse($beforeCreateBookmark);
71
        $this->assertTrue($afterCreateBookmark);
72
    }
73
74
    /**
75
     * @covers \eZ\Publish\Core\Repository\BookmarkService::createBookmark
@@ 95-112 (lines=18) @@
92
    /**
93
     * @covers \eZ\Publish\Core\Repository\BookmarkService::deleteBookmark
94
     */
95
    public function testDeleteBookmark()
96
    {
97
        $repository = $this->getRepository();
98
99
        /* BEGIN: Use Case */
100
        $bookmarkService = $repository->getBookmarkService();
101
        $locationService = $repository->getLocationService();
102
103
        $location = $locationService->loadLocation($this->generateId('location', self::LOCATION_ID_BOOKMARKED));
104
105
        $beforeDeleteBookmark = $bookmarkService->isBookmarked($location);
106
        $bookmarkService->deleteBookmark($location);
107
        $afterDeleteBookmark = $bookmarkService->isBookmarked($location);
108
        /* END: Use Case */
109
110
        $this->assertTrue($beforeDeleteBookmark);
111
        $this->assertFalse($afterDeleteBookmark);
112
    }
113
114
    /**
115
     * @covers \eZ\Publish\Core\Repository\BookmarkService::deleteBookmark