| @@ 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 | { |
|
| @@ 603-623 (lines=21) @@ | ||
| 600 | /** |
|
| 601 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId |
|
| 602 | */ |
|
| 603 | public function testLoadContentInfoByRemoteId() |
|
| 604 | { |
|
| 605 | $contentInfoData = array(new ContentInfo()); |
|
| 606 | $this->getGatewayMock()->expects($this->once()) |
|
| 607 | ->method('loadContentInfoByRemoteId') |
|
| 608 | ->with( |
|
| 609 | $this->equalTo('15b256dbea2ae72418ff5facc999e8f9') |
|
| 610 | )->will( |
|
| 611 | $this->returnValue(array(42)) |
|
| 612 | ); |
|
| 613 | ||
| 614 | $this->getMapperMock()->expects($this->once()) |
|
| 615 | ->method('extractContentInfoFromRow') |
|
| 616 | ->with($this->equalTo(array(42))) |
|
| 617 | ->will($this->returnValue($contentInfoData)); |
|
| 618 | ||
| 619 | $this->assertSame( |
|
| 620 | $contentInfoData, |
|
| 621 | $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9') |
|
| 622 | ); |
|
| 623 | } |
|
| 624 | ||
| 625 | /** |
|
| 626 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::load |
|