Code Duplication    Length = 67-69 lines in 2 locations

Tests/Units/UnitOfWork.php 2 locations

@@ 261-327 (lines=67) @@
258
        ;
259
    }
260
261
    public function testNoChanges()
262
    {
263
        $mapping = $this->getMapping();
264
        $unitOfWork = $this->newTestedInstance($mapping);
265
266
        $this
267
            ->given($newSerializedModel = [
268
                '@id' => '/v12/carts/1',
269
                'cartItemList' => [
270
                    '/v12/cart_items/1',
271
                    '/v12/cart_items/2',
272
                    '/v12/cart_items/3',
273
                ],
274
            ])
275
            ->then
276
                ->variable($unitOfWork->getDirtyData(
277
                    $newSerializedModel,
278
                    [
279
                        '@id' => '/v12/carts/1',
280
                        'cartItemList' => [
281
                            '/v12/cart_items/1',
282
                            '/v12/cart_items/2',
283
                            '/v12/cart_items/3',
284
                        ],
285
                    ],
286
                    $this->getCartMetadata()
287
                ))
288
                ->isEqualTo(
289
                    [
290
                    ]
291
                )
292
            ->then
293
                ->variable($unitOfWork->getDirtyData(
294
                    [
295
                        '@id' => '/v12/carts/1',
296
                        'cartItemList' => [
297
                            [
298
                                '@id' => '/v12/cart_items/1',
299
                                'amount' => 1,
300
                            ],
301
                            [
302
                                '@id' => '/v12/cart_items/2',
303
                                'amount' => 1,
304
                            ],
305
                        ],
306
                    ],
307
                    [
308
                        '@id' => '/v12/carts/1',
309
                        'cartItemList' => [
310
                            [
311
                                '@id' => '/v12/cart_items/1',
312
                                'amount' => 1,
313
                            ],
314
                            [
315
                                '@id' => '/v12/cart_items/2',
316
                                'amount' => 1,
317
                            ],
318
                        ],
319
                    ],
320
                    $this->getCartMetadata()
321
                ))
322
                ->isEqualTo(
323
                    [
324
                    ]
325
                )
326
        ;
327
    }
328
329
    public function testNoMetadata()
330
    {
@@ 329-397 (lines=69) @@
326
        ;
327
    }
328
329
    public function testNoMetadata()
330
    {
331
        $mapping = $this->getMapping();
332
        $unitOfWork = $this->newTestedInstance($mapping);
333
334
        $this
335
            ->given($newSerializedModel = [
336
                '@id' => '/v12/carts/1',
337
                'cartInfo' => [
338
                    [
339
                        'firstname' => 'john',
340
                        'lastname' => 'doe',
341
                    ],
342
                ],
343
            ])
344
            ->then
345
                ->variable($unitOfWork->getDirtyData(
346
                    $newSerializedModel,
347
                    [
348
                        '@id' => '/v12/carts/1',
349
                        'cartInfo' => [
350
                            [
351
                                'firstname' => 'john',
352
                                'lastname' => 'doe',
353
                            ],
354
                        ],
355
                    ],
356
                    $this->getCartMetadata()
357
                ))
358
                ->isEqualTo(
359
                    [
360
                    ]
361
                )
362
            ->then
363
                ->variable($unitOfWork->getDirtyData(
364
                    [
365
                        '@id' => '/v12/carts/1',
366
                        'cartItemList' => [
367
                            [
368
                                '@id' => '/v12/cart_items/1',
369
                                'amount' => 1,
370
                            ],
371
                            [
372
                                '@id' => '/v12/cart_items/2',
373
                                'amount' => 1,
374
                            ],
375
                        ],
376
                    ],
377
                    [
378
                        '@id' => '/v12/carts/1',
379
                        'cartItemList' => [
380
                            [
381
                                '@id' => '/v12/cart_items/1',
382
                                'amount' => 1,
383
                            ],
384
                            [
385
                                '@id' => '/v12/cart_items/2',
386
                                'amount' => 1,
387
                            ],
388
                        ],
389
                    ],
390
                    $this->getCartMetadata()
391
                ))
392
                ->isEqualTo(
393
                    [
394
                    ]
395
                )
396
        ;
397
    }
398
399
    public function testRemoveItem()
400
    {