Completed
Push — master ( 336c64...8fa798 )
by Łukasz
25:31
created

BookmarkServiceTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 54
c 0
b 0
f 0
rs 10
wmc 3
lcom 0
cbo 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
B serviceProvider() 0 41 1
A getServiceMock() 0 4 1
A getSignalSlotService() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\SignalSlot\Tests;
10
11
use eZ\Publish\API\Repository\BookmarkService as APIBookmarkService;
12
use eZ\Publish\API\Repository\Values\Bookmark\BookmarkList;
13
use eZ\Publish\Core\Repository\Values\Content\Location;
14
use eZ\Publish\Core\SignalSlot\BookmarkService;
15
use eZ\Publish\Core\SignalSlot\Signal\BookmarkService\CreateBookmarkSignal;
16
use eZ\Publish\Core\SignalSlot\Signal\BookmarkService\DeleteBookmarkSignal;
17
use eZ\Publish\Core\SignalSlot\SignalDispatcher;
18
19
class BookmarkServiceTest extends ServiceTest
20
{
21
    public function serviceProvider()
22
    {
23
        $location = new Location([
24
            'id' => 60,
25
        ]);
26
27
        return [
28
            [
29
                'createBookmark',
30
                [$location],
31
                null,
32
                1,
33
                CreateBookmarkSignal::class,
34
                [
35
                    'locationId' => $location->id,
36
                ],
37
            ],
38
            [
39
                'deleteBookmark',
40
                [$location],
41
                null,
42
                1,
43
                DeleteBookmarkSignal::class,
44
                [
45
                    'locationId' => $location->id,
46
                ],
47
            ],
48
            [
49
                'loadBookmarks',
50
                [0, 25],
51
                new BookmarkList(),
52
                0,
53
            ],
54
            [
55
                'isBookmarked',
56
                [$location],
57
                false,
58
                0,
59
            ],
60
        ];
61
    }
62
63
    protected function getServiceMock()
64
    {
65
        return $this->createMock(APIBookmarkService::class);
66
    }
67
68
    protected function getSignalSlotService($innerService, SignalDispatcher $dispatcher)
69
    {
70
        return new BookmarkService($innerService, $dispatcher);
71
    }
72
}
73