Code Duplication    Length = 21-21 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Tests/Content/TreeHandlerTest.php 1 location

@@ 27-47 (lines=21) @@
24
 */
25
class TreeHandlerTest extends TestCase
26
{
27
    public function testLoadContentInfoByRemoteId()
28
    {
29
        $contentInfoData = [new ContentInfo()];
30
31
        $this->getContentGatewayMock()
32
            ->expects($this->once())
33
            ->method('loadContentInfo')
34
            ->with(42)
35
            ->will($this->returnValue([42]));
36
37
        $this->getContentMapperMock()
38
            ->expects($this->once())
39
            ->method('extractContentInfoFromRow')
40
            ->with($this->equalTo([42]))
41
            ->will($this->returnValue($contentInfoData));
42
43
        $this->assertSame(
44
            $contentInfoData,
45
            $this->getTreeHandler()->loadContentInfo(42)
46
        );
47
    }
48
49
    public function testListVersions()
50
    {

eZ/Publish/Core/Persistence/Legacy/Tests/Content/ContentHandlerTest.php 1 location

@@ 560-580 (lines=21) @@
557
    /**
558
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId
559
     */
560
    public function testLoadContentInfoByRemoteId()
561
    {
562
        $contentInfoData = [new ContentInfo()];
563
        $this->getGatewayMock()->expects($this->once())
564
            ->method('loadContentInfoByRemoteId')
565
            ->with(
566
                $this->equalTo('15b256dbea2ae72418ff5facc999e8f9')
567
            )->will(
568
                $this->returnValue([42])
569
            );
570
571
        $this->getMapperMock()->expects($this->once())
572
            ->method('extractContentInfoFromRow')
573
            ->with($this->equalTo([42]))
574
            ->will($this->returnValue($contentInfoData));
575
576
        $this->assertSame(
577
            $contentInfoData,
578
            $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9')
579
        );
580
    }
581
582
    /**
583
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::load