Code Duplication    Length = 31-31 lines in 2 locations

eZ/Publish/Core/Persistence/Cache/Tests/ContentHandlerTest.php 2 locations

@@ 396-426 (lines=31) @@
393
    /**
394
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::setStatus
395
     */
396
    public function testSetStatus()
397
    {
398
        $this->loggerMock->expects($this->once())->method('logCall');
399
400
        $innerHandlerMock = $this->createMock(SPIContentHandler::class);
401
        $this->persistenceHandlerMock
402
            ->expects($this->once())
403
            ->method('contentHandler')
404
            ->will($this->returnValue($innerHandlerMock));
405
406
        $innerHandlerMock
407
            ->expects($this->once())
408
            ->method('setStatus')
409
            ->with(2, VersionInfo::STATUS_ARCHIVED, 1)
410
            ->will($this->returnValue(true));
411
412
        $this->cacheMock
413
            ->expects($this->at(0))
414
            ->method('clear')
415
            ->with('content', 2, 1)
416
            ->will($this->returnValue(null));
417
418
        $this->cacheMock
419
            ->expects($this->at(1))
420
            ->method('clear')
421
            ->with('content', 'info', 2, 'versioninfo', 1)
422
            ->will($this->returnValue(null));
423
424
        $handler = $this->persistenceCacheHandler->contentHandler();
425
        $handler->setStatus(2, VersionInfo::STATUS_ARCHIVED, 1);
426
    }
427
428
    /**
429
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::setStatus
@@ 431-461 (lines=31) @@
428
    /**
429
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::setStatus
430
     */
431
    public function testSetStatusPublished()
432
    {
433
        $this->loggerMock->expects($this->once())->method('logCall');
434
435
        $innerHandlerMock = $this->createMock(SPIContentHandler::class);
436
        $this->persistenceHandlerMock
437
            ->expects($this->once())
438
            ->method('contentHandler')
439
            ->will($this->returnValue($innerHandlerMock));
440
441
        $innerHandlerMock
442
            ->expects($this->once())
443
            ->method('setStatus')
444
            ->with(2, VersionInfo::STATUS_PUBLISHED, 1)
445
            ->will($this->returnValue(true));
446
447
        $this->cacheMock
448
            ->expects($this->at(0))
449
            ->method('clear')
450
            ->with('content', 2, 1)
451
            ->will($this->returnValue(null));
452
453
        $this->cacheMock
454
            ->expects($this->at(1))
455
            ->method('clear')
456
            ->with('content', 'info', 2)
457
            ->will($this->returnValue(null));
458
459
        $handler = $this->persistenceCacheHandler->contentHandler();
460
        $handler->setStatus(2, VersionInfo::STATUS_PUBLISHED, 1);
461
    }
462
463
    /**
464
     * @covers \eZ\Publish\Core\Persistence\Cache\ContentHandler::updateMetadata