| @@ 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 | { |
|
| @@ 593-613 (lines=21) @@ | ||
| 590 | /** |
|
| 591 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::loadContentInfoByRemoteId |
|
| 592 | */ |
|
| 593 | public function testLoadContentInfoByRemoteId() |
|
| 594 | { |
|
| 595 | $contentInfoData = array(new ContentInfo()); |
|
| 596 | $this->getGatewayMock()->expects($this->once()) |
|
| 597 | ->method('loadContentInfoByRemoteId') |
|
| 598 | ->with( |
|
| 599 | $this->equalTo('15b256dbea2ae72418ff5facc999e8f9') |
|
| 600 | )->will( |
|
| 601 | $this->returnValue(array(42)) |
|
| 602 | ); |
|
| 603 | ||
| 604 | $this->getMapperMock()->expects($this->once()) |
|
| 605 | ->method('extractContentInfoFromRow') |
|
| 606 | ->with($this->equalTo(array(42))) |
|
| 607 | ->will($this->returnValue($contentInfoData)); |
|
| 608 | ||
| 609 | $this->assertSame( |
|
| 610 | $contentInfoData, |
|
| 611 | $this->getContentHandler()->loadContentInfoByRemoteId('15b256dbea2ae72418ff5facc999e8f9') |
|
| 612 | ); |
|
| 613 | } |
|
| 614 | ||
| 615 | /** |
|
| 616 | * @covers \eZ\Publish\Core\Persistence\Legacy\Content\Handler::load |
|