Code Duplication    Length = 21-22 lines in 3 locations

tests/Unit/Client/ProductClientTest.php 3 locations

@@ 40-61 (lines=22) @@
37
    /**
38
     * @test
39
     */
40
    public function getCategories()
41
    {
42
        $organizationUuid = Uuid::uuid1();
43
        $url = sprintf(ProductClient::GET_CATEGORIES, (string) $organizationUuid);
44
        $data = ['getCategoriesTest'];
45
46
        $izettleClientMock = $this->getIzettleGetMock($url, $data);
47
48
        list($categoryBuilderMock, $discountBuilderMock, $libraryBuilderMock, $productBuilderMock) = $this->getMocks();
49
50
        $categoryBuilderMock->shouldReceive('buildFromJson')->with(json_encode($data))->once();
51
52
        $productClient = new ProductClient(
53
            $izettleClientMock,
54
            $organizationUuid,
55
            $categoryBuilderMock,
56
            $discountBuilderMock,
57
            $libraryBuilderMock,
58
            $productBuilderMock
59
        );
60
        $productClient->getCategories();
61
    }
62
63
    /**
64
     * @test
@@ 90-110 (lines=21) @@
87
    /**
88
     * @test
89
     */
90
    public function getDiscounts()
91
    {
92
        $organizationUuid = Uuid::uuid1();
93
        $data = ['getDiscountsTest'];
94
        $url = sprintf(ProductClient::GET_DISCOUNTS, $organizationUuid);
95
96
        $izettleClientMock = $this->getIzettleGetMock($url, $data);
97
        list($categoryBuilderMock, $discountBuilderMock, $libraryBuilderMock, $productBuilderMock) = $this->getMocks();
98
        $discountBuilderMock->shouldReceive('buildFromJson')->with(json_encode($data))->once();
99
100
        $productClient = new ProductClient(
101
            $izettleClientMock,
102
            $organizationUuid,
103
            $categoryBuilderMock,
104
            $discountBuilderMock,
105
            $libraryBuilderMock,
106
            $productBuilderMock
107
        );
108
109
        $productClient->getDiscounts();
110
    }
111
112
    /**
113
     * @test
@@ 196-216 (lines=21) @@
193
    /**
194
     * @test
195
     */
196
    public function getProducts()
197
    {
198
        $organizationUuid = Uuid::uuid1();
199
        $data = ['getProductsTest'];
200
        $url = sprintf(ProductClient::GET_PRODUCTS, $organizationUuid);
201
202
        $izettleClientMock = $this->getIzettleGetMock($url, $data);
203
        list($categoryBuilderMock, $discountBuilderMock, $libraryBuilderMock, $productBuilderMock) = $this->getMocks();
204
        $productBuilderMock->shouldReceive('buildFromJson')->with(json_encode($data))->once();
205
206
        $productClient = new ProductClient(
207
            $izettleClientMock,
208
            $organizationUuid,
209
            $categoryBuilderMock,
210
            $discountBuilderMock,
211
            $libraryBuilderMock,
212
            $productBuilderMock
213
        );
214
215
        $productClient->getProducts();
216
    }
217
218
    /**
219
     * @test