Code Duplication    Length = 30-30 lines in 2 locations

Tests/Units/Model/Serializer.php 2 locations

@@ 189-218 (lines=30) @@
186
        ;
187
    }
188
189
    public function testSerializeThreeLevel()
190
    {
191
        $this->createNewInstance();
192
193
        $this
194
            ->given($cart = $this->createNewCart())
195
                ->and($cartItem = $this->createNewCartItem())
196
                ->and($cart->addCartItemList($cartItem))
197
            ->then
198
                ->array($data = $this->testedInstance->serialize($cart, 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart'))
199
                    ->isIdenticalTo([
200
                        'status' => 'payed',
201
                        'clientPhoneNumber' => '+33 1 23 45 67 89',
202
                        'createdAt' => (new \DateTime('2015-09-20T12:08:00'))->format(DateTime::RFC3339),
203
                        'cart_items' => [
204
                            [
205
                                'amount' => 2,
206
                                'createdAt' => (new \DateTime('2015-09-20T12:11:00'))->format(DateTime::RFC3339),
207
                                'data' => [
208
                                    'when' => (new \DateTime('2015-09-20T15:00:00'))->format(DateTime::RFC3339),
209
                                    'who' => 'John',
210
                                ],
211
                                'product' => '/v1/products/10',
212
                                'cartItemDetailList' => [],
213
                            ],
214
                        ],
215
                        'order' => null,
216
                    ])
217
        ;
218
    }
219
220
    /**
221
     * testJsonEncodeRelationWithoutLinkMultipleLevel
@@ 357-386 (lines=30) @@
354
     * @access public
355
     * @return void
356
     */
357
    public function testMultipleLevelSerialization()
358
    {
359
        $this->createNewInstance();
360
        $this
361
            ->given($cart = $this->createNewCart())
362
                ->and($cartItem = $this->createNewCartItem())
363
                ->and($cartItem->setCart($cart))
364
            ->then
365
                ->array($this->testedInstance->serialize($cart, 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart'))
366
                    ->isIdenticalTo([
367
                        'status' => 'payed',
368
                        'clientPhoneNumber' => '+33 1 23 45 67 89',
369
                        'createdAt' => (new \DateTime('2015-09-20T12:08:00'))->format(DateTime::RFC3339),
370
                        'cart_items' => [
371
                            [
372
                                'amount' => 2,
373
                                'createdAt' => (new \DateTime('2015-09-20T12:11:00'))->format(DateTime::RFC3339),
374
                                'data' => [
375
                                    'when' => (new \DateTime('2015-09-20T15:00:00'))->format(DateTime::RFC3339),
376
                                    'who' => 'John',
377
                                ],
378
                                'product' => '/v1/products/10',
379
                                'cartItemDetailList' => [],
380
                            ],
381
                        ],
382
                        'order' => null,
383
                    ])
384
385
        ;
386
    }
387
388
    /**
389
     * testLinkedUnserialize