Code Duplication    Length = 31-31 lines in 2 locations

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

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