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 = array(new ContentInfo());
30
31
        $this->getContentGatewayMock()
32
            ->expects($this->once())
33
            ->method('loadContentInfo')
34
            ->with(42)
35
            ->will($this->returnValue(array(42)));
36
37
        $this->getContentMapperMock()
38
            ->expects($this->once())
39
            ->method('extractContentInfoFromRow')
40
            ->with($this->equalTo(array(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

@@ 584-604 (lines=21) @@
581
    /**
582
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId
583
     */
584
    public function testLoadContentInfoByRemoteId()
585
    {
586
        $contentInfoData = array(new ContentInfo());
587
        $this->getGatewayMock()->expects($this->once())
588
            ->method('loadContentInfoByRemoteId')
589
            ->with(
590
                $this->equalTo('15b256dbea2ae72418ff5facc999e8f9')
591
            )->will(
592
                $this->returnValue(array(42))
593
            );
594
595
        $this->getMapperMock()->expects($this->once())
596
            ->method('extractContentInfoFromRow')
597
            ->with($this->equalTo(array(42)))
598
            ->will($this->returnValue($contentInfoData));
599
600
        $this->assertSame(
601
            $contentInfoData,
602
            $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9')
603
        );
604
    }
605
606
    /**
607
     * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::load